### FILE="Main.annotation"
# Copyright:	Public domain.
# Filename:	PINBALL_GAME_BUTTONS_AND_LIGHTS.agc
# Purpose:	Part of the source code for Solarium build 55. This
#		is for the Command Module's (CM) Apollo Guidance
#		Computer (AGC), for Apollo 4.
# Assembler:	yaYUL --block1
# Contact:	Jim Lawton <jim DOT lawton AT gmail DOT com>
# Website:	www.ibiblio.org/apollo/index.html
# Page scans:	www.ibiblio.org/apollo/ScansForConversion/Solarium055/
# Mod history:	2009-09-23 JL	Created.

## Page 481

# KEYBOARD AND DISPLAY PROGRAM
#
#
#
# THE FOLLOWING QUOTATION IS PROVIDED THROUGH THE COUTESY OF THE AUTHORS.
#
#	''IT WILL BE PROVED TO THY FACE THAT THOU HAST MEN ABOUT THEE THAT
# USUALLY TALK OF A NOUN AND A VERB, AND SUCH ABOMINABLE WORDS AS NO
# CHRISTIAN EAR CAN ENDURE TO HEAR.''
#
#			HENRY 6, ACT 2, SCENE 4
#
#
#
# SUMMARY OF ERASABLE ASSIGNMENTS FOR KEYBOARD AND DISPLAY PROGRAM 
# WHICH ARE ALL DEFINED ELSEWHERE.
#
#
#
#		SETLOC	627
#
# BUFFER STORAGE AREAS FOR ROUTINES USING DISPLAY OR LOAD ROUTINES.
# DSPTEM1	ERASE	+2		# BUFFER STORAGE AREA 1 (MOSTLY FOR TIME)
# DSPTEM2	ERASE	+2		# BUFFER STORAGE AREA 2 (MOSTLY FOR DEG)
#
# ERASABLE ASSIGNMENTS SPECIFIC TO PINBALL
#
#
#
# ERASABLES RESERVED FOR EXECUTIVE ACTION
#
# DSPCOUNT	ERASE			# DISPLAY POSITION INDICATOR
# DECBRNCH	ERASE			# +DEC, - DEC, OCT INDICATOR
# VERBREG	ERASE			# VERB CODE
# NOUNREG	ERASE			# NOUN CODE
# XREG		ERASE			# R1 INPUT BUFFER
# YREG		ERASE			# R2 INPUT BUFFER
# ZREG		ERASE			# R3 INPUT BUFFER
# XREGLP	ERASE			# LO PART OF XREG (FOR DEC CONV ONLY)
# YREGLP	ERASE			# LO PART OF YREG (FOR DEC CONV ONLY)
# ZREGLP	ERASE			# LO PART OF ZREG (FOR DEC CONV ONLY)
# MODREG	ERASE			# MODE CODE
# DSPLOCK	=	STATE (BIT4)	# KEYBOARD/SUBROUTINE CALL INTERLOCK
# REQRET	ERASE			# RETURN REGISTER FOR LOAD
# LOADSTAT	ERASE			# STATUS INDICATOR FOR LOADTST
# CLPASS	ERASE			# PASS INDICATOR CLEAR
# NOUT		ERASE			# ACTIVITY COUNTER FOR DSPTAB
# NOUNCADR	ERASE			# MACHINE CADR FOR NOUN
# MONSAVE	ERASE			# N/V CODE FOR MONITOR. ALSO ACTIVITY
# MONSAVE1	ERASE			# NOUNADD STORAGE FOR MONITOR WITH MATBS
# DSPTAB	ERASE	+13D		# 0-10, DISPLAY PANEL BUFFER. 11-13, C RELAYS
## Page 482
# CADRSTOR	ERASE			# ENDIDLE STORAGE
# GRABLOCK	ERASE			# INTERNAL INTERLOCK FOR DISPLAY SYSTEM
# NVSBCADR	ERASE			# NVSUB STORAGE FOR CALLING CADR
# DSPLIST	ERASE	+2		# WAITING REG FOR DSP SYST INTERNAL USE
# END OF ERASABLES RESERVED FOR PINBALL EXECUTIVE ACTION.
#
# ERASABLES RESERVED FOR INTERRUPT ACTION
#
# IN0WORD	ERASE			# INPUT CODE STORAGE (KEYRUPT OR UPRUPT)
# DSPCNT	ERASE			# COUNTER FOR DSPOUT
#
#
#
# TEMPORARY ERASABLES FOR EXECUTIVE ACTION
#
# DSEXIT	=	COMPON		# RETURN FOR DSPIN
# EXITEM	=	COMPON		# RETURN FOR SCALE FACTOR ROUTINE SELECT
# BLANKRET	=	COMPON		# RETURN FOR 2BLANK
#
# WRDRET	=	TEM9		# RETURN FOR 5BLANK
# WDRET		=	TEM9		# RETURN FOR DSPWD
# DECRET	=	TEM9		# RETURN FOR PUTCOM(DEC LOAD)
# 21/22REG	=	TEM9		# TEMP FOR CHARIN
#
# UPDATRET	=	ORDER		# RETURN FOR UPDATNN, UPDATVB
# CHAR		=	ORDER		# TEMP FOR CHARIN
# ERCNT		=	ORDER		# COUNTER FOR ERROR LIGHT RESET
# DECOUNT	=	ORDER		# COUNTER FOR SCALING AND DISPLAY (DEC)
#
# SGNON		=	TEM11		# TEMP FOR +,- ON
# NOUNTEM	=	TEM11		# COUNTER FOR MIXNOUN FETCH
# DISTEM	= 	TEM11		# COUNTER FOR OCTAL DISPLAY VERBS
# DECTEM	=	TEM11		# COUNTER FOR FETCH (DEC DISPLAY VERBS)
# DECTEM1	=	TEM11		# TEMP FOR NUM
#
# SGNOFF	=	DVSW		# TEMP FOR +,- ON
# NVTEMP	=	DVSW		# TEMP FOR NVSUB
# SFTEMP1	=	DVSW		# STORAGE FOR SF CONST HI PART (=SFTEMP2-1)
# DECTEM2	=	DVSW		# TEMP FOR NUM
#
# CODE		=	BRANCHQ		# FOR DSPIN
# SFTEMP2	=	BRANCHQ		# STORAGE FOR SF CONST LO PART (=SFTEMP1+1)
#
# ENTRET	=	MODE		# EXIT FROM ENTER
#
# PROGREG	=	VBUF +2		# FOR GO EXEC PROGRAM
# MIXTEMP	=	VBUF +2		# FOR MIXNOUN DATA
# SIGNRET	=	VBUF +2		# RETURN FOR +,- ON
#
## Page 483

# ALSO PROGREG+1, PROGREG+2. MIXTEMP+1, MIXTEMP+2.
#
# WDCNT		=	VBUF +5		# CHAR COUNTER FOR DSPWD
# INREL		=	VBUF +5		# INPUT BUFFER SELECTOR ( X,Y,Z, REG )
#
# MIXBR		=	TEM10		# INDICATOR FOR MIXED OR NORMAL NOUN
# DSPMMTEM	=	TEM10		# DSPCOUNT SAVE FOR DSPMM
#
# MONTEM	=	NEWEQIND	# TEMP RETURN FOR MONITOR
# DSREL		=	TEM2		# REL ADDRESS FOR DSPIN (TEM2 USED BY DAD1)
#
# DSMAG		=	TEM4		# MAGNITUDE STORE FOR DSPIN
# IDADDTEM	=	TEM4		# MIXNOUN INDIRECT ADDRESS STORAGE
#
# COUNT		=	TEM5		# FOR DSPIN  (TEM5 IS USED BY DAD)
# LSTPTR	=	ARETURN		# LIST POINTER FOR GRABUSY
# RELRET	=	ARETURN		# RETURN FOR RELDSP
# FREERET	=	ARETURN		# RETURN FOR FREEDSP
#
# CADRTEM	=	ESCAPE		# TEMP STORAGE FOR GRAB ROUTINES
#
# NNADTEM	ERASE			# TEMP FOR NOUN ADDRESS TABLE ENTRY
# NNTYPTEM	ERASE			# TEMP FOR NOUN TYPE TABLE ENTRY
# IDAD1TEM	ERASE			# TEMP FOR INDIR ADDRES TABLE ENTRY(MIXNN)
#					# MUST = IDAD2TEM-1, = IDAD3TEM-2.
# IDAD2TEM	ERASE			# TEMP FOR INDIR ADDRES TABLE ENTRY(MIXNN)
#					# MUST = IDAD1TEM+1, = IDAD3TEM-1.
# IDAD3TEM	ERASE			# TEMP FOR INDIR ADDRES TABLE ENTRY(MIXNN)
#					# MUST = IDAD1TEM+2, = IDAD2TEM+1.
#
#
#
# TEMPORARY ERASABLES FOR INTERRUPT ACTION
#
# KEYTEMP1	=	WTEXIT		# TEMP FOR KEYRUPT, UPRUPT
# DSRUPTEM	=	WTEXIT		# TEMP FOR DSPOUT
# KEYTEMP2	=	RUPTAGN		# TEMP FOR KEYRUPT, UPRUPT

## Page 484

# THE INPUT CODES ASSUMED FOR THE KEYBOARD ARE,
# 0		10000
# 1		00001
# 9		01001
# VERB		10001
# ERROR RES	10010
# KEY RLSE	11001
# +		11010
# -		11011
# ENTER		11100
# CLEAR		11110
# NOUN		11111
#
#
#
# OUTPUT FORMAT FOR DISPLAY PANEL. SET OUT0 TO  AAAABCCCCCDDDDD.
# A'S SELECT A RELAYWORD. THIS DETERMINES WHICH PAIR OF CHARACTERS ARE
# ENERGIZED.
# B FOR SPECIAL RELAYS SUCH AS SIGNS ETC.
# C'S  5 BIT RELAY CODE FOR LEFT CHAR OF PAIR SELECTED BY RELAYWORD.
# D'S  5 BIT RELAY CODE FOR RIGHTCHAR OF PAIR SELECTED BY RELAYWORD.
#
# THE PANEL APPEARS AS FOLLOWS,
# MD1	MD2 				(MAJOR MODE)
# VD1	VD2 (VERB)	ND1	ND2	(NOUN)
# R1D1	R1D2	R1D3	R1D4	R1D5 	(R1)
# R2D1	R2D2	R2D3	R2D4	R2D5 	(R2)
# R3D1	R3D2	R3D3	R3D4	R3D5 	(R3)
#
# EACH OF THESE IS GIVEN A DSPCOUNT NUMBER FOR USE WITHIN COMPUTATION ONLY
# MD1	25	R2D1	11		ALL ARE OCTAL
# MD2	24	R2D2	10
# VD1	23	R2D3	7
# VD2	22	R2D4	6
# ND1	21	R2D5	5
# ND2	20	R3D1	4
# R1D1	16	R3D2	3
# R1D2	15	R3D3	2
# R1D3	14	R3D4	1
# R1D4	13	R3D5	0
# R1D5	12
#
#
#
# THERE IS AN 11-REGISTER TABLE (DSPTAB) FOR THE DISPLAY PANEL.
#
# DSPTAB	RELAYWD		BIT11		BITS 10-6	BITS 5-1
# RELADD
# 10		1011				MD1 (25)	MD2  (24)
# 9		1010		FLASH		VD1 (23)	VD2  (22)
## Page 485
# 8		1001				ND1 (21)	ND2  (20)
# 7		1000		UPACT				R1D1 (16)
# 6		0111		+R1		R1D2 (15)	R1D3 (14)
# 5		0110		-R1		R1D4 (13)	R1D5 (12)
# 4		0101		+R2		R2D1 (11)	R2D2 (10)
# 3		0100		-R2		R2D3 (7)	R2D4 (6)
# 2		0011				R2D5 (5)	R3D1 (4)
# 1		0010		+R3		R3D2 (3)	R3D3 (2)
# 0		0001		-R3		R3D4 (1)	R3D5 (0)
#		0000	    NO RELAYWORD
#
#
#
# THE 5-BIT RELAY CODES ARE,
# BLANK		00000
# 0		10101
# 1		00011
# 2		11001
# 3		11011
# 4		01111
# 5		11110
# 6		11100
# 7		10011
# 8		11101
# 9		11111

## Page 486

		SETLOC	14000

FLASHON		XCH	Q
		TS	DSEXIT
		TC	FLASHON1

FLASHOFF	XCH	Q
		TS	DSEXIT
		TC	FLASHOF1
					# END OF STANDARD LEAD INS.



CHARIN		TC	DSPLOCK		# BLOCK DISPLAY SYST BUT SAVE OLD
		MASK	BIT4		# C(DSPLOCK) FOR ERROR LIGHT RESET.
		TS	21/22REG
		XCH	MPAC
		TS	CHAR
		INDEX	A
		TC	+1		# INPUT CODE	FUNCTION
		TC	CHARALRM	# 0
		TC	NUM		# 1
		TC	NUM		# 2
		TC	NUM		# 3
		TC	NUM		# 4
		TC	NUM		# 5
		TC	NUM		# 6
		TC	NUM		# 7
		TC	89TEST		# 10		    8
		TC	89TEST		# 11		    9
		TC	CHARALRM	# 12
		TC	CHARALRM	# 13
		TC	CHARALRM	# 14
		TC	CHARALRM	# 15
		TC	CHARALRM	# 16
		TC	CHARALRM	# 17
		TC	NUM -2		# 20		    0
		TC	VERB		# 21		    VERB
		TC	ERROR		# 22		    ERROR LIGHT RESET
		TC	ABORTCAL	# 23
		TC	CHARALRM	# 24
		TC	CHARALRM	# 25
		TC	CHARALRM	# 26
		TC	CHARALRM	# 27
		TC	CHARALRM	# 30
		TC	VBRELDSP	# 31		    KEY RELEASE
		TC	POSGN		# 32		    +
		TC	NEGSGN		# 33		    -
		TC	ENTERJMP	# 34		    ENTER
		TC	CHARALRM	# 35
## Page 487
		TC	CLEAR		# 36		    CLEAR
		TC	NOUN		# 37		    NOUN



ENTERJMP	TC	POSTJUMP
		CADR	ENTER

ABORTCAL	CAF	OCT32
		TC	POSTJUMP	# FORCE DECODING OF VERB 72 AND DO RELDSP.
		CADR	JAMEXTVB

OCT32		OCT	32



89TEST		CAF	THREE
		MASK	DECBRNCH
		CCS	A
		TC	NUM		# IF DECBRNCH IS +, 8 OR 9 OK
		TC	CHARALRM	# IF DECBRNCH IS +0, REJECT 8 OR 9



# NUM ASSEMBLES OCTAL 3 BITS AT A TIME. FOR DECIMAL IT CONVERTS INCOMING
# WORD AS A FRACTION, KEEPING RESULTS TO DP.
# OCTAL RESULTS ARE LEFT IN XREG, YREG, OR ZREG. HI PART OF DEC IN XREG,
# YREG, ZREG. THE LOW PARTS IN XREGLP, YREGLP, OR ZREGLP.
# DECBRNCH IS LEFT AT +0 FOR OCT, +1 FOR + DEC, +2 FOR - DEC.
# IF DSPCOUNT WAS LEFT -, NO MORE DATA IS ACCEPTED.

		CAF	ZERO
		TS	CHAR
NUM		CCS	DSPCOUNT
		TC	+4		# +
		TC	+3		# +0
		TC	+1		# -BLOCK DATA IN IF DSPCOUNT IS -
		TC	ENDOFJOB	# -0
		TC	GETINREL
		CCS	CLPASS		# IF CLPASS IS + OR +0, MAKE IT +0.
		CAF	ZERO
		TS	CLPASS
		TC	+1
		INDEX	CHAR
		CAF	RELTAB
		MASK	LOW5
		TS	CODE
		XCH	DSPCOUNT
		TS	COUNT
		TS	DSPCOUNT
## Page 488
		TC	DSPIN
		CAF	THREE
		MASK	DECBRNCH
		CCS	A		# +0, OCTAL.  +1, + DEC.  +2, - DEC.
		TC	DECTOBIN	# +
		INDEX	INREL		# +0 OCTAL
		XCH	VERBREG
		TS	CYL
		CS	CYL
		CS	CYL
		XCH	CYL
		AD	CHAR
		TC	ENDNMTST
DECTOBIN	INDEX	INREL
		XCH	VERBREG
		TS	MPAC		# SUM X 2EXP-14 IN MPAC
		CAF	ZERO
		TS	MPAC +1
		CAF	TEN		# 10 X 2EXP-14
		TC	SHORTMP		# 10SUM X 2EXP-28 IN MPAC, MPAC+1
		XCH	MPAC +1
		AD	CHAR
		TS	MPAC +1
		TC	ENDNMTST	# NO OF
		AD	MPAC		# OF MUST BE 5TH CHAR
		TS	MPAC
		TC	DECCEND
ENDNMTST	INDEX	INREL
		TS	VERBREG
		CS	DSPCOUNT
		INDEX	INREL
		AD	CRITCON
		CCS	A
		TC	CHARALRM	# +	 PATHOLOGICAL CASE
		TC	CHARALRM	# +0	IMPOSSIBLE
		TC	MORNUM		# -
ENDNUM		CAF	THREE
		MASK	DECBRNCH
		CCS	A
		TC	DECCEND
ENDALL		CS	DSPCOUNT	# BLOCK NUMIN BY PLACING DSPCOUNT
		TC	MORNUM +1	# NEGATIVELY
DECEND		CAF	THREE
		MASK	DECBRNCH
		INDEX	A
		TC	+0
		TC	+DECSGN		# + DEC
		TC	DMP		# - DEC
		XCADR	NEGDECON
		TC	ENDECOM		# MULT SUM X 2EXP-28 IN MPAC, MPAC+1 BY
## Page 489
+DECSGN		TC	DMP		# 2EXP14/10EXP5, GIVES (SUM/10EXP5)X2EXP-14
		XCADR	DECON		# IN MPAC, +1, +2.
ENDECOM		XCH	MPAC +2
		INDEX	INREL
		TS	XREGLP -2
		XCH	MPAC +1
		INDEX	INREL
		TS	VERBREG
		TC	ENDALL
MORNUM		CCS	DSPCOUNT	# DECREMENT DSPCOUNT
		TS	DSPCOUNT
		TC	ENDOFJOB

CRITCON		OCT	22		# (DEC 18)
		OCT	20		# (DEC 16)
		OCT	12		# (DEC 10)
		OCT	5
		OCT	0

DECON		2DEC	1 E-5 B14	# 2EXP14/10EXP5 = .16384 DEC

NEGDECON	OCT	72603
		OCT	64516



# GETINREL GETS PROPER DATA REG REL ADDRESS FOR CURRENT C(DSPCOUNT) AND
# PUTS IT INTO INREL. +0 VERBREG, 1 NOUNREG, 2 XREG, 3 YREG, 4 ZREG.

GETINREL	INDEX	DSPCOUNT
		CAF	INRELTAB
		TS	INREL		# (A TEMP, REG)
		TC	Q

INRELTAB	OCT	4		# R3D5 (DSPCOUNT = 0)
		OCT	4		# R3D4		 =(1)
		OCT	4		# R3D3		 =(2)
		OCT	4		# R3D2		 =(3)
		OCT	4	 	# R3D1		 =(4)
		OCT	3		# R2D5		 =(5)
		OCT	3		# R2D4		 =(6)
		OCT	3		# R2D3		 =(7)
		OCT	3		# R2D2		 =(8D)
		OCT	3		# R2D1		 =(9D)
		OCT	2		# R1D5		 =(10D)
		OCT	2		# R1D4		 =(11D)
		OCT	2		# R1D3		 =(12D)
		OCT	2		# R1D2		 =(13D)
		OCT	2		# R1D1		 =(14D)
		TC	CCSHOLE		# NO DSPCOUNT NUMBER = 15D
## Page 490
		OCT	1		# ND2		 =(16D)
		OCT	1		# ND1		 =(17D)
		OCT	0		# VD2		 =(18D)
		OCT	0		# VD1		 =(19D)



VERB		CAF	ZERO
		TS	VERBREG
		TS	CODE		# VERB CANT USE 2BLANK SINCE THAT TURNS
		CAF	VD1		# THE FLASH OFF
		TS	DSPCOUNT
		TS	COUNT
		TC	DSPIN
		CAF	VD2
		TS	COUNT
		CAF	ZERO
		TS	CODE
		TC	DSPIN
N/VCOM		CAF	ZERO
		TS	DECBRNCH
		TS	REQRET		# SET FOR ENTPAS0
		CAF	ENDINST		# IF DSPALARM OCCURS BEFORE FIRST ENTPAS0
		TS	ENTRET		# OR NVSUB, ENTRET MUST ALREADY BE SET
					# TO TC ENDOFJOB
		TC	ENDOFJOB
NOUN		CAF	ZERO
		TS	NOUNREG
		CAF	ND1		# ND1, OCT 21 (DEC 17)
		TS	DSPCOUNT
		TC	2BLANK
		TC	N/VCOM



VD2		=	CRITCON		# OCT 22



NEGSGN		TC	SIGNTEST
		TC 	-ON
		CAF	TWO
BOTHSGN		AD	DECBRNCH	# SET DEC COMP BIT TO 1 (IN DECBRNCH)
		INDEX	INREL		# BIT 5 FOR R1
		AD	BIT7		# BIT 4 FOR R2
		TS	DECBRNCH	# BIT 3 FOR R3
FIXCLPAS	CCS	CLPASS		# IF CLPASS IS + OR +0, MAKE IT +0.
		CAF	ZERO
		TS	CLPASS
		TC	+1
## Page 491
		TC	ENDOFJOB

POSGN		TC	SIGNTEST
		TC	+ON
		CAF	ONE
		TC	BOTHSGN

+ON		XCH	Q
		TS	SIGNRET
		TC	GETINREL
		INDEX	INREL
		CAF	SGNTAB -2
		TS	SGNOFF
		AD 	ONE
		TS	SGNON
SGNCOM		CAF	ZERO
		TS	CODE
		XCH	SGNOFF
		TC	11DSPIN
		CAF	BIT11
		TS	CODE
		XCH	SGNON
		TC	11DSPIN
		TC	SIGNRET
-ON		XCH	Q
		TS	SIGNRET
		TC	GETINREL
		INDEX	INREL
		CAF	SGNTAB -2
		TS	SGNON
		AD	ONE
		TS	SGNOFF
		TC	SGNCOM

SGNTAB		OCT	5		# -R1
		OCT	3		# -R2
		OCT	0		# -R3



SIGNTEST	XCH	Q		# ALLOWS +,- ONLY WHEN DSPCOUNT=R1D1,
		TS	SIGNRET		# R2D1, OR R3D1. ALLOWS ONLY FIRST OF
		CAF	THREE		# CONSECUTIVE +/- CHARACTERS.
		MASK	DECBRNCH
		CCS	A		# IF LOW2 BITS OF DECBRNCH NOT = 0, SIGN
		TC	ENDOFJOB	# FOR THIS WORD ALREADY IN. REJECT.
		CS	R1D1
		TC	SGNTST1
		CS	R2D1
		TC	SGNTST1
## Page 492
		CS	R3D1
		TC	SGNTST1
		TC	ENDOFJOB	# NO MATCH FOUND. SIGN ILLEGAL
SGNTST1		AD	DSPCOUNT
		CCS	A
		TC	Q
		TC	CCSHOLE
		TC	Q
		TC	SIGNRET		# SIGN LEGAL



# ERROR LIGHT RESET RESETS TMALM, DSPALARM (CHECK FAIL), PROGALM, UNBLOCKS
# ENDPULSES, RESETS ERRUPT TRAP. IT ALSO FORCES BIT 12 OF ALL DSPTAB
# ENTRIES TO ONE. RESETS UPACT LIGHT.

ERROR		CS	BIT4		# RESTORE ORIGINAL C(DSPLOCK) BIT4 OF
		INHINT			# STATE. THUS ERROR LIGHT RESET LEAVES
		MASK	DSPLOC		# DSPLOCK UNCHANGED.
		AD	21/22REG
		TS	DSPLOCK
		CS	BIT7		# RESET ERRUPT TRAP
		MASK	OUT1
		AD	BIT7
		TS	OUT1
		CS	CFAILCON	# RESET THE C RELAYS FOR IMU FAIL, CDUFAIL
		MASK	DSPTAB +11D	# PIPA FAIL.
		AD	BIT15
		TS	DSPTAB +11D
		CS	ERCON
		MASK	OUT1
		TS	OUT1
TSTAB		CAF	BINCON		# (DEC 10)
		TS	ERCNT		# ERCNT = COUNT
		INHINT
		INDEX	ERCNT
		CCS	DSPTAB
		AD	ONE
		TC	ERPLUS
		AD	ONE
ERMINUS		CS	A
		MASK	NOTBIT12
		TC	ERCOM
ERPLUS		CS	A
		MASK	NOTBIT12
		CS	A		# MIGHT WANT TO RESET CLPASS, DECBRNCH,
ERCOM		INDEX	ERCNT		# ETC.
		TS	DSPTAB
		RELINT
		CCS	ERCNT
## Page 493
		TC	TSTAB +1
		CCS	WASKSET
		TC	ERROPT
		TC	ERROPT
		TC	ERROPT
		XCH	IN3
		XCH	IN3
		MASK	LOW7
		TS	WASKSET

ERROPT		CCS	WASOPSET
		TC	ERROR1
		TC	ERROR1
		TC	ERROR1
		XCH	IN3
		XCH	IN3
		MASK	OPTICSB
		TS	WASOPSET

ERROR1		CAF	ZERO
		TS	FAILREG
		TS	OLDERR
		TS	SFAIL
		TS	CODE
		CAF	SEVEN
		TC	11DSPIN		# TURN OFF UPACT LIGHT
		TC	ENDOFJOB

OPTICSB		OCT	35000
ERCON		OCT	01131		# BITS 1, 4, 5, 7, 10.
					# PROGALM, TMFAIL, CHECK FAIL, ERRUPT TRAP
					# END PULSES.

NOTBIT12	OCT	73777
CFAILCON	OCT	40340



# CLEAR BLANKS WHICH R1, R2, R3 IS CURRENT OR LAST TO BE DISPLAYED (PERTINE
# NT XREG,YREG,ZREG IS CLEARED). SUCCESSIVE CLEARS TAKE CARE OF EACH RX
# L/ RC UNTIL R1 IS DONE. THEN NO FURTHER ACTION.
#
# THE SINGLE COMPONENT LOAD VERBS ALLOW ONLY THE SINGLE RC THAT IS
# APPROPRIATE TO BE CLEARED.
#
# CLPASS	+0  PASS0, CAN BE BACKED UP
#		+NZ  HIPASS, CAN BE BACKED UP
#		-NZ  PASS0, CANNOT BE BACKED UP

CLEAR		CCS	DSPCOUNT
## Page 494
		AD	ONE
		TC	+2
		AD	ONE
		INDEX	A		# DO NOT CHANGE DSPCOUNT BECAUSE MAY
		CAF	INRELTAB	# FAIL LEGALTST.
		TS	INREL		# MUST SET INREL, EVEN FOR HIPASS.
		CCS	CLPASS
		TC	CLPASHI		# +
		TC	+2		# +0	IF CLPASS IS +0 OR -, IT IS PASS0
		TC	+1		# -
		TC	LEGALTST
		TC	CLEAR1
CLPASHI		CCS	INREL
		TS	INREL
		TC	LEGALTST
		CAF	DOUBLK +2	# +3 TO - NUMBER. BACKS UP DATA REQUESTS
		TS	REQRET
		XCH	INREL
		TS	MIXTEMP		# TEMP STORAGE FOR INREL
		XCH	VERBREG		# DECREMENT VERB AND RE-DISPLAY
		AD	NEG1
		TS	VERBREG
		TC	BANKCALL
		CADR	UPDATVB
		XCH	MIXTEMP
		TS	INREL		# RESTORE INREL
CLEAR1		TC	CLR5
		CAF	ONE
		AD	CLPASS		# ONLY IF CLPASS IS + OR +0,
		TS	CLPASS		# SET FOR HIGHER PASS.
		TC	ENDOFJOB
CLR5		XCH	Q		# USED 5BLANK  BUT AVOIDS ITS TC GETINREL
		TC	5BLANK +3
LEGALTST	CS	TWO
		AD	INREL
		CCS	A
		TC	Q		# LEGAL  INREL G/ 2
		TC	CCSHOLE
		TC	ENDOFJOB	# ILLEGAL   INREL= 0,1
		TC	Q		# LEGAL    INREL = 2



# 5BLANK BLANKS 5 CHAR DISPLAY WORD IN R1, R2, OR R3. IT ALSO ZEROES XREG,
# YREG, OR ZREG. PLACE ANY + DSPCOUNT NUMBER FOR PERTINENT RC INTO DSPCOUNT
# DSPCOUNT IS LEFT SET TO LEFT MOST DSP NUMB FOR RC JUST BLANKED.

5BLANK		XCH	Q
## Page 495
		TS	WRDRET
		TC	GETINREL
		CAF	ZERO
		INDEX	INREL
		TS	VERBREG		# ZERO X, Y, Z, REG.
		INDEX	INREL
		TS	XREGLP -2
		TS	CODE
		INDEX	INREL		# ZERO PERTINENT DEC COMP BIT.
		CS	BIT7		# PROTECT OTHERS
		MASK	DECBRNCH
		MASK	BRNCHCON	# ZERO LOW 2 BITS.
		TS	DECBRNCH
		INDEX	INREL
		CAF	SINBLANK -2	# BLANK ISOLATED CHAR SEPARATELY
		TS	COUNT
		TC	DSPIN
5BLANK1		INDEX	INREL
		CAF	DOUBLK -2
		TS	DSPCOUNT
		TC	2BLANK
		CS	TWO
		AD	DSPCOUNT
		TS	DSPCOUNT
		TC	2BLANK
		INDEX	INREL
		CAF	R1D1 -2
		TS	DSPCOUNT	# SET DSPCOUNT TO LEFT MOST DSP NUMBER
		TC	WRDRET		# OF REG. JUST BLANKED

SINBLANK	OCT	16		# DEC 14
		OCT	5
		OCT	4
DOUBLK		OCT	15		# DEC 13
		OCT	11		# DEC 9
		OCT	3

BRNCHCON	OCT	77774

# 2BLANK BLANKS TWO CHAR. PLACE DSP NUMBER OF LEFT CHAR  OF THE PAIR INTO
# DSPCOUNT. THIS NUMBER IS LEFT IN DSPCOUNT

2BLANK		XCH	Q
		TS	BLANKRET
		CS	DSPCOUNT
		CS	A
		TS	SR
		CS	BLANKCON
		INHINT
		INDEX	SR
## Page 496
		XCH	DSPTAB
		CCS	A
		TC	INCNOUT		# IF OLD CONTENTS +,+1 TO NOUT
		TC	CCSHOLE
		RELINT			# IF -,NOUT OK
		TC	BLANKRET
BLANKCON	OCT	4000

INCNOUT		XCH	NOUT
		AD	ONE
		TS	NOUT
		INDEX	Q
		TC	1		# RETURN TO 2+ L(CALLING TC)

## Page 497

# ENTER PASS 0 IS THE EXECUTE FUNCTION. HIGHER ORDER ENTERS ARE TO LOAD
# DATA. THE SIGN OF REQRET DETERMINES THE PASS, + FOR PASS 0,- FOR HIGHER
# PASSES.

		SETLOC	16000

NVSUBB		TC	NVSUB1		# STANDARD LEAD INS, DONT MOVE.
GRABUSYB	TC	GRABUSY1
NVSUBSYB	TC	NVSUBSY1
DSPMM		XCH	Q
		TS	UPDATRET
		TC	DSPMM1
LOADLV1		TC	LOADLV
					# END OF STANDARD LEAD INS.



ENTER		CAF	ZERO
		TS	CLPASS
		CAF	ENDINST
		TS	ENTRET
		CCS	REQRET
		TC	ENTPAS0		# IF +, PASS 0
		TC	ENTPAS0		# IF +, PASS 0
		TC	+1		# IF -, NOT PASS 0
		CAF	THREE		# IF DEC, ALARM IF LESS THAN 5 CHAR IN
		MASK	DECBRNCH	# BUT LEAVE REQRET - AND FLASH ON, SO
		CCS	A		# OPERATOR CAN SUPPLY MISSING NUMERICAL
		TC	+2		# CHARACTERS AND CONTINUE.
		TC	ACCEPTWD	# OCTAL. ANY NUMBER OF CHAR OK.
		CCS	DSPCOUNT
		TC	GODSPALM	# LESS THAN 5 CHAR DEC(DSPCOUNT IS +)
		TC	GODSPALM	# LESS THAN 5 CHAR DEC(DSPCOUNT IS +)
		TC	+1		# 5 CHAR IN (DSPCOUNT IS -)
ACCEPTWD	CS	REQRET		# 5 CHAR IN (DSPCOUNT IS -)
		TS	REQRET		# SET REQRET +.
		TC	FLASHOFF
		TC	REQRET

ENTEXIT		=	ENTRET

ENTPAS0		CAF	ZERO		#  NOUN VERB SUB ENTERS HERE
		TS	DECBRNCH
TESTVB		CS	VERBREG		# IF VERB IS 32-77, SKIP NOUN TEST
		AD	LOWVERB		# 32-VB
		CCS	A
		TC	TESTNN		# VERB L/ 32
LOWVERB		OCT	32		# LOWER VERB THAT AVOIDS NOUN TEST
		TC	+1		# VERB G/ 32
## Page 498
		TC	VERBFAN		# VERB=32
TESTNN		CAF	LODNNLOC	# SWITCH BANKS TO NOUN TABLE READING
		TC	SWCALL		# ROUTINE.
		INDEX	MIXBR
		TC	+0
		TC	+2		# NORMAL
		TC	MIXNOUN		# MIXED
		CCS	NNADTEM		# NORMAL
		TC	VERBFAN -2	#      NORMAL IF +
		TC	GODSPALM	# NOT IN USE   IF +0
		TC	REQADD		# SPECIFY MACHINE ADDRESS IF -
		CAF	R3D1		# AUGMENT MACHINE ADDRESS IF -0
		TS	DSPCOUNT
		XCH	NOUNADD
		AD	ONE
		TS	NOUNADD
		TC	DSPOCTWD
		TC	VERBFAN
REQADD		CAF	BIT15		# SET CLPASS FOR PASS0 ONLY
		TS	CLPASS
		CS	ENDINST
		AD	ENTEXIT
		CCS	A		# TEST IF REACHED HERE FROM INTERNAL OR
		TC	INTMATBS	#		FROM EXTERNAL
		TC	CCSHOLE
		TC	INTMATBS		
		TC	REQDATZ		# EXTERNAL MACH CADR TO BE SPECIFIED
		CCS	DECBRNCH
		TC	GODSPALM	# ALARM IF DECIMAL USED FOR MATBS
		XCH	ZREG		# OCTAL USED	OK
		TS	NOUNADD
		CAF	LODNNLOC	# SWITCH BANKS TO NOUN TABLE READING
		TC	SWCALL		# ROUTINE.
		TC	VERBFAN

LODNNLOC	CADR	LODNNTAB

INTMATBS	CS	BIT4
		MASK	VERBREG		# MAKES VB 15 LOOK LIKE VB 05.
		AD	NEG5
		CCS	A
		TC	DSPADD		# VB NOT = 05 OR 15, DISPLAY ADDRESS.
NEG5		OCT	77772
		TC	DSPADD		# VB NOT = 05 OR 15, DISPLAY ADDRESS.
		TC	VERBFAN		# VB = 05 OR 15, DO NOT DISPLAY ADDRESS.
DSPADD		CAF	R3D1
		TS	DSPCOUNT
		CS	NOUNADD
		CA	A
		TC	DSPOCTWD
## Page 499
		TC	VERBFAN

		AD	ONE
		TS	NOUNADD
VERBFAN		CS	LST2CON
		AD	VERBREG		# VERB-LST2CON
		CCS	A
		AD	ONE		# VERB G/ LST2CON
		TC	+2
		TC	VBFANDIR	# VERB L/ LST2CON
JAMEXTVB	TS	MPAC		# SPECIAL ENTRY FOR FORCING EXTENDED VERB.
		TC	RELDSP		# RELEASE DISPLAY SYST
		XCH	MPAC		# ALSO TURN OFF RELEASE DISPLAY SYST LIGHT
		AD	LST2CADR
		TC	BANKJUMP
LST2CON		OCT	40		# FIRST LST2 VERB
LST2CADR	CADR	LST2FAN		# THE LST2 FAN IS LOCATED IN BANK 05

VBFANDIR	INDEX	VERBREG
		CAF	VERBTAB
		TC	BANKJUMP

VERBTAB		CADR	GODSPALM	# VB00 ILLEGAL
		CADR	DSPA		# VB01 DISPLAY OCT COMP 1 (R1)
		CADR	DSPB		# VB02 DISPLAY OCT COMP 2 (R1)
		CADR	DSPC		# VB03 DISPLAY OCT COMP 3 (R1)
		CADR	DSPAB		# VB04 DISPLAY OCT COMP 1,2 (R1,R2)
		CADR	DSPABC		# VB05 DISPLAY OCT COMP 1,2,3 (R1,R2,R3)
		CADR	DECDSP		# VB06 DECIMAL DISPLAY
		CADR	DSPDPDEC	# VB07 DP DECIMAL DISPLAY (R1,R2)
		CADR	VBRQWAIT	# VB10 REQUEST WAITLIST
		CADR	MONITOR		# VB11 MONITOR OCT COMP 1 (R1)
		CADR	MONITOR		# VB12 MONITOR OCT COMP 2 (R1)
		CADR	MONITOR		# VB13 MONITOR OCT COMP 3 (R1)
		CADR	MONITOR		# VB14 MONITOR OCT COMP 1,2 (R1,R2)
		CADR	MONITOR		# VB15 MONITOR OCT COMP 1,2,3 (R1,R2,R3)
		CADR	MONITOR		# VB16 MONITOR DECIMAL
		CADR	MONITOR		# VB17 MONITOR DP DEC  (R1,R2)
REQEXLOC	CADR	VBRQEXEC	# VB20 REQUEST EXECUTIVE
		CADR	ALOAD		# VB21 LOAD COMP 1 (R1)
		CADR	BLOAD		# VB22 LOAD COMP 2 (R2)
		CADR	CLOAD		# VB23 LOAD COMP 3 (R3)
		CADR	ABLOAD		# VB24 LOAD COMP 1,2 (R1,R2)
		CADR	ABCLOAD		# VB25 LOAD COMP 1,2,3 (R1,R2,R3)
		CADR	GODSPALM	# VB26 SPARE
		CADR	GODSPALM	# VB27 SPARE
		CADR	GODSPALM	# VB30 SPARE
		CADR	DSPBANK		# VB31 BANK DISPLAY
		CADR	BUMP		# VB32 C(R2) INTO R3, C(R1) INTO R2
		CADR	VBPROC		# VB33 PROCEED WITHOUT DATA
## Page 500
		CADR	VBTERM		# VB34 TERMINATE CURRENT TEST OR LOAD REQ
		CADR	VBRELDSP	# VB35 RELEASE DISPLAY SYST
		CADR	SLAPB		# VB36 FRESH START
		CADR	MMCHANG		# VB37 CHANGE MAJOR MODE



# THE LIST2 VERBFAN IS LOCATED IN BANK 05.

## Page 501

# NNADTAB CONTAINS A RELATIVE ADDRESS, IDADDREL(IN LOW 10 BITS), REFERRING
# TO WHERE 3 CONSECUTIVE ADDRESSES ARE STORED (IN IDADDTAB).
# MIXNOUN GETS DATA AND STORES IN MIXTEMP,+1,+2. IT SETS NOUNADD FOR
# MIXTEMP.

MIXNOUN		CCS	NNADTEM
		TC	+4		# +  IN USE
		TC	GODSPALM	# +0  NOT IN USE
		TC	+2		# -  IN USE
		TC	+1		# -0  IN USE
		CS	SIX
		AD	VERBREG
		CCS	A		# AVOID MIXNOUN SWAP FOR OTHER THAN
		TC	VERBFAN		#	DISPLAY VERBS
		TC	CCSHOLE
		TC	+1
		CAF	TWO
MIXNN1		TS	NOUNTEM
		AD	MIXAD
		TS	NOUNADD		# SET NOUNADD TO MIXTEMP + K
		INDEX	NOUNTEM
		CS	IDAD1TEM	# GET IDADDTAB ENTRY FOR COMPONENT K
		CS	A		# OF NOUN.
		TS	DECOUNT
					# TEST FOR DP (FOR OCT DISPLAY). IF SO, GET
					#   MINOR PART ONLY.
		MASK	HI5
		TC	LEFT5		# SF ROUT NUMBER IN A
		TC	DPTEST
		TC	MIXNN2		# NO DP
		CAF	ONE		# DP  GET MINOR PART
		AD	DECOUNT
		TS	DECOUNT
MIXNN2		XCH	DECOUNT
		MASK	LOW10		# ESUBK (NO DP)  OR  (ESUBK)+1    FOR DP
		INDEX	A		# PICK UP C(ESUBK)  NOT DP.
		CS	0		# OR C((ESUBK)+1)  FOR DP MINOR PART
		CS	A
		INDEX	NOUNADD
		XCH	0		# STORE IN MIXTEM + K
		CCS	NOUNTEM
		TC	MIXNN1
		TC	VERBFAN

MIXAD		TC	MIXTEMP



DPTEST		TS	SFTEMP1		# ENTER WITH SF ROUT NUMBER IN A.
		XCH	Q		# RETURNS TO L+1 IF NO DP
## Page 502
		XCH	SFTEMP1		# RETURNS TO L+2 IF DP
		INDEX	A
		TCF	+1
		TC	SFTEMP1		# OCTAL ONLY  NO DP
		TC	SFTEMP1		# FRACT NO DP
		TC	SFTEMP1		# DEG  NO DP
		TC	SFTEMP1		# ARITH  NO DP
		TCF	DPTEST1		# DP1OUT
		TCF	DPTEST1		# DP2OUT
		TC	SFTEMP1		# OPDEG  NO DP
		TCF	DPTEST1		# DP3OUT
DPTEST1		INDEX	SFTEMP1
		TC	1		# RETURN TO L+2



REQDATX		CS	Q
		TS	REQRET
		CAF	R1D1
		TC	REQCOM
REQDATY		CS	Q
		TS	REQRET
		CAF	R2D1
		TC	REQCOM
REQDATZ		CS	Q
		TS	REQRET
		CAF	R3D1
REQCOM		TS	DSPCOUNT
		TC	BANKCALL
		CADR	5BLANK
		TC	BANKCALL
		CADR	FLASHON
		CS	ENDINST
		AD	ENTEXIT
		CCS	A
		TC	+4		# ENTEXIT NOT ENDOFJOB. NVSUB INITIATED
		TC	CCSHOLE
		TC	+2		# ENTEXIT NOT ENDOFJOB. NVSUB INITIATED
		TC	ENTEXIT		# ENTEXIT = ENDOFJOB. EXTERNALLY INITIATED
		CS	ZERO		# NVSUB INITIATED LOAD. SET CADRSTOR TO -0
		TS	CADRSTOR
		TC	ENTEXIT

# IF NVSUB INITIATED LOAD, SET CADRSTOR TO -0 TO TELL RECALTST TO RELEASE
# DISPLAY IF ENDIDLE WAS NOT USED. (NECESSARY FRO DATAWAIT)



		TS	NOUNREG
UPDATNN		XCH	Q
## Page 503
		TS	UPDATRET
		CAF	LODNNLOC	# SWITCH BANKS TO NOUN TABLE READING
		TC	SWCALL		# ROUTINE.
		CCS	NNADTEM
		AD	ONE		# NORMAL
		TCF	PUTADD
		TCF	PUTADD +1	# MATBS	 DONT CHANGE NOUNADD
		TCF	PUTADD +1	# MATBI	 DONT CHANGE NOUNADD
PUTADD		TS	NOUNADD
		CAF	ND1
		TS	DSPCOUNT
		CS	NOUNREG
		TC	UPDAT1

		TS	VERBREG
UPDATVB		XCH	Q
		TS	UPDATRET
		CAF	VD1
		TS	DSPCOUNT
		CS	VERBREG
UPDAT1		CS	A
		TC	DSP2BIT
		TC	UPDATRET



GODSPALM	TC	POSTJUMP
		CADR	DSPALARM

## Page 504

# 	NOUN TABLES
# NOUN CODE L/55, NORMAL CASE. NOUN CODE G/E 55, MIXED NOUN CASE.
# FOR NORMAL CASE, NNADTAB CONTAINS ONE MACHINE ADDRESS FOR EACH NOUN.
# +0 INDICATES NOUN NOT USED.   - ENTRY IDICATES MACHINE ADDRESS TO BE
# SPECIFIED.      -0 INDICATES AUGMENT OF LAST MACHINE ADDRESS.
#
# FOR MIXED CASE, NNADTAB CONTAINS ONE INDIRECT ADDRESS(IDADDREL) IN LOW
# 10 BITS, AND THE COMPONENT CODE NUMBER IN THE HIGH 5 BITS.
#
# NNTYPTAB IS A PACKED TABLE OF THE FORM MMMMMNNNNNPPPPP.
#
# FOR THE NORMAL CASE, M'S ARE THE COMPONENT CODE NUMBER.
#		       N'S ARE THE SF ROUTINE CODE NUMBER.
#		       P'S ARE THE SF CONSTANT CODE NUMBER.
#
# MIXED-CASE,M'S ARE THE SF CONSTANT3 CODE NUMBER	3 COMPONENT CASE
#	     N'S ARE THE SF CONSTANT2 CODE NUMBER
#	     P'S ARE THE SF CONSTANT1 CODE NUMBER
#	     N'S ARE THE SF CONSTANT2 CODE NUMBER	2 COMPONENT CASE
#	     P'S ARE THE SF CONSTANT1 CODE NUMBER
#	     P'S ARE THE SF CONSTANT1 CODE NUMBER	 1 COMPONENT CASE
#
# THERE IS ALSO AN INDIRECT ADDRESS TABLE(IDADDTAB) FOR MIXED CASE ONLY.
# ENTRY IS OF FORM RRRRREEEEEEEEEE. IDADDREL IS THE RELATIVE ADDRESS OF
# THE FIRST OF THESE ENTRIES.
# R'S ARE THE SF ROUTINE CODE NUMBERS FOR COMPONENT K
# E'S ARE THE MACHINE ADDRESS FOR COMPONENT K
# THERE IS ONE ENTRY IN THIS TABLE FOR EACH COMPONENT OF A MIXED NOUN
# THEY ARE LISTED IN ORDER OF ASCENDING K.
#
# IN OCTAL DISPLAY AND LOAD (OCT OR DEC) VERBS, EXCLUDE USE OF VERBS WHOSE
# COMPONENT NUMBER IS GREATER THAN THE NUMBER OF COMONENTS IN NOUN.
# ALL MACHINE ADDRESS TO BE SPECIFIED NOUNS ARE 1 COMPONENT.
# ONLY EXCEPTION IS NOUN 01 TO ALLOW OCTAL DISPLAYS AND LOADS OF
# AN UNCONTOLLED NUMBER OF COMPONENTS.
#
#
#
# IN MULTI-COMPONENT LOAD VERBS, NO MIXING OF OCTAL AND DECIMAL DATA
# COMPONENT WORDS IS ALLOWED. ALARM IF VIOLATION.
#
# IN DECIMAL LOADS OF DATA, 5 NUMERICAL CHARACTERS MUST BE KEYED IN
# BEFORE EACH ENTER. IF NOT, ALARM.

## Page 505

# 	DISPLAY VERBS
DSPABC		CS	TWO
		TC	COMPTEST
		INDEX	NOUNADD
		CS	2
		XCH	BUF +2
DSPAB		CS	ONE
		TC	COMPTEST
		INDEX	NOUNADD
		CS	1
		XCH	BUF +1
DSPA		TC	TSTFORDP
		INDEX	NOUNADD
		CS	0
DSPCOM1		XCH	BUF
		TC	DSPCOM2
DSPB		CS	ONE
		TC	COMPTEST
		INDEX	NOUNADD
		CS	1
		TC	DSPCOM1
DSPC		CS	TWO
		TC	COMPTEST
		INDEX	NOUNADD
		CS	2
		TC	DSPCOM1
DSPCOM2		CS	TWO		# A  B  C  AB  ABC
		AD	VERBREG		# -1 -0 +1 +2  +3   IN A
		CCS	A		# +0 +0 +0 +1  +2    IN A AFTER CCS
		TC	DSPCOM3
		TC	ENTEXIT
		TC	+1
DSPCOM3		TS	DISTEM		# +0 +1 +2 INTO DISTEM
		INDEX	A
		CAF	R1D1
		TS	DSPCOUNT
		INDEX	DISTEM
		CS	BUF
		TC	DSPOCTWO
		XCH	DISTEM
		TC	DSPCOM2 +2

# COMPTEST ALARMS IF COMPONENT NUMBER OF VERB(LOAD OR OCT DISPLAY) IS
# GREATER THAN THE HIGHEST COMPONENT NUMBER OF NOUN.
# NOUN 01 IS EXCLUDED FROM TEST.
COMPTEST	TS	SFTEMP1		# - VERB COMP
		XCH	Q
COMPTST1	CS	ONE
		AD	NOUNREG
## Page 506
		CCS	A
		TC	+4		# NOUN NOT = 01
		TC	CCSHOLE
		TC	+2		# NOUN NOT = 01
		TC	SFTEMP2		# NOUN = 01. ANY COMP OK
		INDEX	MIXBR
		CAF	COMPICK -1
		INDEX	A
		CS	0		# MUST NOT DESTROY NNADTEM OR NNTYPTEM
		CS	A
		MASK	HI5
		TC	LEFT5		# NOUN COMP
		AD	SFTEMP1		# NOUN COMP - VERB COMP
		CCS	A
		TC	SFTEMP2		# NOUN COMP G/ VERB COMP
		TC	CCSHOLE
		TC	GODSPALM	# NOUN COMP L/ VERB COMP
		TC	SFTEMP2		# NOUN COMP = VERB COMP



TSTFORDP	XCH	Q		# TEST FOR DP. IF SO, GET MINOR PART ONLY.
		TS	DECOUNT
		INDEX	MIXBR
		TC	+0
		TC	+2		# NORMAL
		TC	DECOUNT		# MIXED CASE ALREADY HANDLED IN MIXNOUN
		TC	SFRUTNOR
		TC	DPTEST
		TC	DECOUNT		# NO DP
		XCH	NOUNADD		# DP
		AD	ONE
		TS	NOUNADD		# E+1 INTO NOUNADD FOR MINOR PART.
		TC	DECOUNT



COMPICK		ADRES	NNTYPTEM
		ADRES	NNADTEM

DECDSP		INDEX	MIXBR		# NORMAL		MIXED
		CAF	COMPICK -1	# ADRES NNTYPTEM	ADRES NNADTEM
		INDEX	A
		CA	0		# MUST NOT DESTORY NNADTEM OR NNTYPTEM
		CS	A		# C(NNTYPTEM)		C(NNADTEM)
		MASK	HI5		# GET HI5 OF NNTYPTAB(NORM) OF NNADTAB(MIX)
		TC	LEFT5
		TS	DECOUNT		# COMP NUMBER INTO DECOUNT
DSPDCGET	TS	DECTEM		# PICKS UP DATA
		AD	NOUNADD		# DECTEM  1COMP +0, 2COMP +1, 3COMP +2
## Page 507
		INDEX	A
		CS	0
		INDEX	DECTEM
		XCH	XREG		# CANT USE BUF SINCE DMP USES IT.
		CCS	DECTEM
		TC	DSPDCGET	# MORE TO GET
DSPDCPUT	CAF	ZERO		# DISPLAYS DATA
		TS	MPAC +1		# DECOUNT 1COMP +0, 2COMP +1, 3COMP +2
		TS	MPAC +2
		INDEX	DECOUNT
		CAF	R1D1
		TS	DSPCOUNT
		INDEX	DECOUNT
		CS	XREG
		TS	MPAC
		TC	SFCONUM		# SF CON NUMB IN A
		TS	SFTEMP2
		TC	BANKCALL	# SWITCH BANKS TO SF CONSTANT READING
		CADR	GTSFOUT		# ROUTINE. LOADS SFTEMP1, SFTEMP2.
		INDEX	MIXBR
		TC	+0
		TC	DSPSFNOR
		TC	SFRUTMIX
		TC	DECDSP3

DSPSFNOR	TC	SFRUTNOR
		TC	DECDSP3

DSPDCEND	TC	BANKCALL	# ALL SFOUT ROUTINES END HERE
		CADR	DSPDECWD
		CCS	DECOUNT
		TC	+2
		TC	ENTEXIT
		TS	DECOUNT
		TC	DSPDCPUT	# MORE TO DISPLAY



DECDSP3		INDEX	A
		CAF	SFOUTABR
		TC	BANKJUMP

SFOUTABR	CADR	DSPALARM	# ALARM IF DEC DISP WITH OCTAL ONLY NOUN
		CADR	DSPDCEND
		CADR	DEGOUTSF
		CADR	ARTOUTSF

		CADR	DP1OUTSF
		CADR	DP2OUTSF
		CADR	OPDEGOUT
## Page 508
		CADR	DP3OUTSF
ENDRTOUT	EQUALS



# 	THE FOLLOWING IS A TYPICAL SF ROUTINE. IT USES MPAC. LEAVES RESU
# LTS IN MPAC, MPAC+1. ENDS WITH TC DSPDCEND



		SETLOC	INCNOUT +5

#    DEGOUTSF SCALES BY .18 THE LOW 14 BITS OF ANGLE , ADDING .18 FOR
# NUMBERS IN THE NEGATIVE (AGC) RANGE.

DEGOUTSF	CAF	ZERO
		TS	MPAC +2		# SET INDEX FOR FULL SCALE
		TC	FIXRANGE
		TC	+2		# NO AUGMENT NEEDED (SFTEMP1 AND 2 ARE 0)
		TC	SETAUG		# SET AUGMENTER ACCORDING TO C(MPAC +2)
		TC	DEGCOM

#   OPDEGOUT SCALES BY .09 FOR ONE RANGE AND BY .45 FOR THE OTHER.
# FOR THE .45 RANGE A .2 BIAS IS ALSO ADDED.



# OPDEGOUT IS USED TO TEST BIT 13 OF WASOPSET (1 = 90 DEG RANGE, 0 = 180).
# SINCE THAT BIT IS ALWAYS 1 IN BLOCK 50 - 100, DON'T TEST IT NOW
OPDEGOUT	CCS	MPAC		# 90 DEG RANGE ALWAYS
		XCH	MPAC		# IF POS OR POS 0 THEN ADD BIAS AND
		TC	+3		# CORRECT FOR POSSIBLE OVERFLOW
		TC	NEGOPT		# IF NEG NON ZERO
		AD	NEG1		# IF NEG ZERO SUBTRACT 1
		AD	20BIAS
BIASCOM		TS	MPAC		# TEST FOR OVEFLOW
		TC	+4		# NO OVFLOW
		CAF	BIT15		# IF OVFLOW
		AD	MPAC
		TS	MPAC
		CAF	TWO		# SET MULTIPLIER TO .45
		TC	DEGOUTSF +1

NEGOPT		XCH	MPAC		# NEGATIVE CASE
		AD	20BIAS
		CCS	A
		TC	BIASCOM		# IF POS THEN SUBTRACT 1 BECASUE OF 2SCOM
		TC	CCSHOLE
		AD	ONE		# IF NEG RESTORE SUM
		COM			# IF NEG 0 LEAVE NEG 0
## Page 509
		TC	BIASCOM

SETAUG		INDEX	MPAC +2		# LOADS SFTEMP1 AND SFTEMP2 WITH THE
		CAF	DEGTAB2		# DP AUGMENTER CONSTANT
		TS	SFTEMP2
		INDEX	MPAC +2
		CAF	DEGTAB1
		TS	SFTEMP1
		TC	Q

FIXRANGE	XCH	Q		# IF MPAC IS + RETURN TO L+1
		TS	WDRET		# IF MPAC IS - RETURN TO L+2 AFTER
		CCS	MPAC		# MASKING OUT THE SIGN BIT
		TC	WDRET
		TC	WDRET
		TC	+1
		CS	BIT15
		MASK	MPAC
		TS	MPAC
		INDEX	WDRET
		TC	1

DEGCOM		INDEX	MPAC +2		# LOADS MULTIPLIER, DOES SHORTMP, AND
		CAF	DEGTAB2		# ADDS AUTMENTER.
		TS	MPAC +1
		INDEX	MPAC +2
		CAF	DEGTAB1
		XCH	MPAC		# ADJUSTED ANGLE IN A
		TC	SHORTMP
		TC	DAD
		ADRES	SFTEMP1
		TC	SCOUTEND



DEGTAB1		OCT	05605		# HI PART OF 	.18
		OCT	02702		#		.09
		OCT	16314		# .45

DEGTAB2		OCT	03656		# LOW PART OF	.18
		OCT	21727		# 		.09
		OCT	31463		# .45

20BIAS		OCT	16040		# 20 DEG BIAS FOR OPTICS

ARTOUTSF	XCH	SFTEMP2		# ASSUMES POINT AT LEFT OF DP SFCON.
		TS	MPAC +1
		XCH	SFTEMP1		# HI PART OF SFCONSTANT
		XCH	MPAC
		TC	SHORTMP
## Page 510
SCOUTEND	TC	POSTJUMP
		CADR	DSPDCEND

DP1OUTSF	TC	DPOUT		# SCALES MPAC, MPAC +1 BY DP SCALE FACTOR
		XCH	MPAC +2		# IN SFTEMP1, SFTEMP2.  THEN SCALE RESULT
		XCH	MPAC +1		# BY B14.
		TS	MPAC
		TC	SCOUTEND



DP2OUTSF	TC	DPOUT		# SCALES MPAC, MPAC +1 BY DP SCALE FACTOR
		TC	SCOUTEND



DP3OUTSF	TC	DPOUT		# ASSUMES POINT BETWEEN BITS 7-8 OF HIGH
		TC	TPLEFT7		# PART OF SFCON. SHIFTS RESULTS LEFT 7.
		TC	SCOUTEND



# DPOUT PICKS UP FRESH DATA FOR BOTH HI AND LO COMPONENTS.
# THIS IS NEEDED FOR TIME DISPLAY.

DPOUT		XCH	Q
		TS	OVFIND
		INDEX	MIXBR
		TC	+0
		TC	DPOUTNOR
		INDEX	DECOUNT
		CS	IDAD1TEM	# GET IDADDTAB ENTRY FOR COMPONENT K
		CS	A		# OF NOUN.
		MASK	LOW10		# E SUBK
DPOUTCOM	TS	MPAC +2
		INHINT
		INDEX	MPAC +2
		CS	0		# MIXED		NORMAL
		COM			# C(ESUBK)	C(E)
		XCH	MPAC
		INDEX	MPAC +2
		CS	1		# C((E SUBK)+1)	C(E+1)
		RELINT
		COM
		XCH	MPAC +1
		CCS	MPAC +1		# TEST IF LOW PART +0 IN CASE PICKING UP
		TC	+3		# TIME, IF SO COULD HAVE OVFLOD, SO GET
		TC	+0CASE		# UP TO DATE HIGH PART. IF NOT +0, NO
		TC	+1		# PROBLEM.
+0RET		TC	DMP
## Page 511
		XCADR	SFTEMP1
		TC	BANKCALL
		CADR	TPAGREE
		TC	OVFIND

+0CASE		INDEX	MPAC +2
		AD	0
		XCH	MPAC
		TC	+0RET

DPOUTNOR	CS	NOUNADD
		CS	A		# E
		TC	DPOUTCOM

# THIS IS A SPECIAL PURPOSE VERB FOR DISPLAYING A DOUBLE PRECISION AGC
# WORD AS 10 DECIMAL DIGITS ON THE AGC DISPLAY PANEL.  IT CAN BE USED WITH
# ANY NOUN, EXCEPT MIXED NOUNS. IT DISPLAYS THE CONTENTS
# OF THE REGISTER NOUNADD IS POINTING TO.  IF USED WITH NOUNS WHICH ARE
# INHERENTLY NOT DP SUCH AS THE CDU COUNTERS THE DISPLAY WILL BE GARBAGE.
# DISPLAY IS IN R1 AND R2 ONLY WITH THE SIGN IN R1.



DSPDPDEC	INDEX	MIXBR
		TC	+0
		TC	+2		# NORMAL NOUN
		TC	DSPALARM
		INDEX	NOUNADD
		CS	0
		COM
		XCH	MPAC		# LOAD MPAC WITH HIGH ORDER PART
		INDEX	NOUNADD
		CS	1
		COM
		XCH	MPAC +1		# LOAD MPAC+1 WITH LOW ORDER PART
		CAF	R1D1
		TS	DSPCOUNT
		CAF	ZERO
		TS	MPAC +2
		TC	BANKCALL
		CADR	TPAGREE
		TC	DSP2DEC
ENDDPDEC	TC	ENTEXIT

## Page 512

# 	LOAD VERBS



		SETLOC	ENDRTOUT

ABCLOAD		CS	TWO
		TC	COMPTEST
		CAF	VBSP1LD
		TC	UPDATVB -1
		TC	REQDATX
		CAF	VBSP2LD
		TC	UPDATVB -1
		TC	REQDATY
		CAF	VBSP3LD
		TC	UPDATVB -1
		TC	REQDATZ



PUTXYZ		CS	SIX		# TEST THAT THE 3 DATA WORDS LOADED ARE
		TC	ALLDC/OC	# ALL DEC OR ALL OCT.
		CAF	LODNNLOC	# SWITCH BANKS TO NOUN TABLE READING
		TC	SWCALL		# ROUTINE.
		CAF	ZERO		# X COMP
		TC	PUTCOM
		INDEX	NOUNADD
		TS	0
		CAF	ONE		# Y COMP
		TC	PUTCOM
		INDEX	NOUNADD
		TS	1
		CAF	TWO		# Z COMP
		TC	PUTCOM
		INDEX	NOUNADD
		TS	2
		TC	LOADLV

ABLOAD		CS	ONE
		TC	COMPTEST
		CAF	VBSP1LD
		TC	UPDATVB -1
		TC	REQDATX
		CAF	VBSP2LD
		TC	UPDATVB -1
		TC	REQDATY
PUTXY		CS	FIVE		# TEST THAT THE 2 DATA WORDS LOADED ARE
		TC	ALLDC/OC	# ALL DEC OR ALL OCT.
		CAF	LODNNLOC	# SWITCH BANKS TO NOUN TABLE READING
		TC	SWCALL		# ROUTINE.
## Page 513
		CAF	ZERO		# X COMP
		TC	PUTCOM
		INDEX	NOUNADD
		TS	0
		CAF	ONE		# Y COMP
		TC	PUTCOM
		INDEX	NOUNADD
		TS	1
		TC	LOADLV

ALOAD		TC	REQDATX
		CAF	LODNNLOC	# SWITCH BANKS TO NOUN TABLE READING
		TC	SWCALL		# ROUTINE.
		CAF	ZERO		# X COMP
		TC	PUTCOM
		INDEX	NOUNADD
		TS	0
		TC	LOADLV

BLOAD		CS	ONE
		TC	COMPTEST
		CAF	BIT15		# SET CLPASS FOR PASS0 ONLY
		TS	CLPASS
		TC	REQDATY
		CAF	LODNNLOC	# SWITCH BANKS TO NOUN TABLE READING
		TC	SWCALL		# ROUTINE.
		CAF	ONE
		TC	PUTCOM
		INDEX	NOUNADD
		TS	1
		TC	LOADLV

CLOAD		CS	TWO
		TC	COMPTEST
		CAF	BIT15		# SET CLPASS FOR PASS0 ONLY
		TS	CLPASS
		TC	REQDATZ
		CAF	LODNNLOC	# SWITCH BANKS TO NOUN TABLE READING
		TC	SWCALL		# ROUTINE.
		CAF	TWO
		TC	PUTCOM
		INDEX	NOUNADD
		TS	2
		TC	LOADLV

LOADLV		CAF	ZERO
		TS	DECBRNCH
		CS	ZERO
		TS	LOADSTAT
		CS	VD1		# TO BLOCK NUMERICAL CHARACTERS AND
## Page 514
		TS	DSPCOUNT	# CLEARS AFTER A COMPLETED LOAD
		TC	POSTJUMP	# AFTER COMPLETED LOAD, GO TO RECALTST
		CADR	RECALTST	# TO SEE IF THERE IS RECALL FROM ENDIDLE.

VBSP1LD		OCT	21		# VB21 = ALOAD
VBSP2LD		OCT	22		# VB22 = BLOAD
VBSP3LD		OCT	23		# VB23 = CLOAD



ALLDC/OC	TS	DECOUNT		# TESTS THAT DATA WORDS LOADED ARE EITHER
		XCH	Q		# ALL DEC OR ALL OCT. ALARMS IF NOT.
		TS	DECRET
		CS	DECBRNCH
		TS	SR
		CS	SR
		CS	SR		# SHIFTED RIGHT 2
		CCS	A		# DEC COMP BITS IN LOW 3
		TC	+2		# SOME ONES IN LOW 3
		TC	DECRET		# ALL ZEROS. ALL OCTAL.  OK
		AD	DECOUNT		# DEC COMP = 7 FOR 3COMP, =6 FOR 2COMP
		CCS	A		# (BUT IT HAS BEEN DECREMENTED BY CCS)
		TC	GODSPALM	# MUST MATCH 6 FOR 3COMP, 5 FOR 2COMP.
		TC	CCSHOLE
		TC	GODSPALM
		TC	DECRET		# ALL REQUIRED ARE DEC. OK



SFRUTNOR	XCH	Q		# GETS SF ROUTINE NUMBER FOR NORMAL CASE
		TS	EXITEM
		CAF	MID5
		MASK 	NNTYPTEM
		TC	RIGHT5
		TC	EXITEM		# SF ROUTINE NUMBER IN A

SFRUTMIX	XCH	Q		# GETS SF ROUTINE NUMBER FOR MIXED CASE
		TS	EXITEM
		INDEX	DECOUNT
		CS	IDAD1TEM	# GET IDADDTEAB ENTRY FOR COMPONENT K
		CS	A		# OF NOUN.
		MASK	HI5
		TC	LEFT5
		TC	EXITEM		# SF ROUTINE NUMBER IN A

SFCONUM		XCH	Q		# GETS SF CONSTANT NUMBER
		TS	EXITEM
		INDEX	MIXBR
		TC	+0
		TC	CONUMNOR	# NORMAL NOUN
## Page 515
		INDEX	DECOUNT		# MIXED NOUN
		CAF	LOW5
		MASK	NNTYPTEM
		INDEX	DECOUNT
		INDEX	DISPLACE
		TC	0
# DO TC SFRET (DECOUNT=0),DO TC RIGHT5(DECOUNT=1), DO TC LEFT5 (DECOUNT=2).
SFRET		TC	EXITEM		# SF CON NUMBER IN A

DISPLACE	TC	SFRET
		TC	RIGHT5
		TC	LEFT5

CONUMNOR	CAF	LOW5		# NORMAL NOUN ALWAYS GETS LOW 5 OF
		MASK	NNTYPTEM
		TC	EXITEM



PUTCOM		TS	DECOUNT
		XCH	Q
		TS	DECRET
		CAF	ZERO
		TS	OVFIND
		INDEX	DECOUNT
		XCH	XREGLP
		TS	MPAC +1
		INDEX	DECOUNT
		XCH	XREG
		TS	MPAC
		INDEX	MIXBR
		TC	+0
		TC	PUTNORM		# NORMAL NOUN
# IF MIXNOUN, PLACE ADDRESS FOR COMPONENT K INTO NOUNADD
		INDEX	DECOUNT
		CA	IDAD1TEM	# GET IDADDTAB ENTRY FOR COMPONENT K
		CS	A		# OF NOUN.
		MASK	LOW10		# EK	FOR CURRENT NOUN
		EXTEND
		SU	DECOUNT
		TS	NOUNADD		# PLACE (E SUB K) - K INTO NOUNADD
		CCS	DECBRNCH
		TC	PUTDECSF	# +  DEC
		TC	SFRUTMIX	# +0 OCTAL
		TC	DPTEST
		TC	PUTCOM2		# NO DP
					# TEST FOR DP SCALE FOR OCT LOAD. IF SO,
					# +0 INTO MAJOR PART. SET NOUNADD FOR
					# LOADING OCTAL WORD INTO MINOR PART.
PUTDPCOM	CAF	ONE		# DP
## Page 516
		AD	NOUNADD
		TS	NOUNADD		# (ESUBK)+1  OR  E+1
		AD	DECOUNT		# NOUNADD NOW SET FOR MINOR PART
		TS	DECOUNT		# (ESUBK)+1  OR  E+1  INTO DECOUNT
		CAF	ZERO		# NOUNADD SET FOR MINOR PART
		INDEX	DECOUNT
		TS	0 -1		# ZERO MAJOR PART(ESUBK OR E)
		TC	PUTCOM2

PUTNORM		CCS	DECBRNCH
		TC	PUTDECSF	# +  DEC
		TC	SFRUTNOR	# +0  OCTAL
		TC	DPTEST
		TC	PUTCOM2		# NO DP
		CAF	ZERO
		TS	DECOUNT
		TC	PUTDPCOM

PUTCOM2		XCH	MPAC
		TC	DECRET

# PUTDECSF FINDS MIXBR AND DECOUNT STILL SET FROM PUTCOM

PUTDECSF	TC	SFCONUM		# SF CON NUMB IN A
		TS	SFTEMP2
		TC	BANKCALL	# SWITCH BANKS TO SF CONSTANT TABLE READING
		CADR	GTSFIN		# ROUTINE. LOADS SFTEMP1, SFTEMP2.
		INDEX	MIXBR
		TC	+0
		TC	PUTSFNOR
		TC	SFRUTMIX
		TC	PUTDCSF2
PUTSFNOR	TC	SFRUTNOR

PUTDCSF2	INDEX	A
		CAF	SFINTABR
		TC	BANKJUMP	# SWITCH BANKS FOR EXPANSION ROOM
SFINTABR	CADR	DSPALARM	# ALARM IF DEC LOAD WITH OCTAL ONLY NOUN
		CADR	BINROUND
		CADR	DEGINSF
		CADR	ARTHINSF
		CADR	DPINSF
		CADR	DPINSF2
		CADR	OPTDEGIN
		CADR	DPINSF		# SAME AS ARITHDP1
ENDRUTIN	EQUALS



# SCALE FACTORS FOR THOSE ROUTINES NEEDING THEM ARE AVAILABLE IN SFTEMP1.
## Page 517
# ALL SFIN ROUTINES USE MPAC MPAC+1. LEAVE RESULT IN A. END WITH TC DECRET



		SETLOC	ENDDPDEC +1

# DEGINSF APPLIES 1000/180 * 5.55555(10) = 5.43434(8)

DEGINSF		TC	DMP		# SF ROUTINE FOR DEC DEGREES
		XCADR	DEGCON1		# MULT BY 5.5  5(10)X2/-3
		CCS	MPAC +1		# THIS ROUNDS OFF MPAC+1 BEFORE SHIFT
		CAF	BIT11		# LEFT 3, AND CAUSES 360.00 TO OF/UF
		TC	+2		# WHEN SHIFTED LEFT AND ALARM.
		CS	BIT11
		AD	MPAC +1
		TC	2ROUND +2
		TC	BANKCALL	# LEFT 1
		CADR	SL1 +3
DEGINSF2	TC	BANKCALL	# LEFT 2
		CADR	SL1 +3
		CCS	MPAC
		TC	SIGNFIX		# IF +, GO TO SIGNFIX
		TC	SIGNFIX		# IF +0, GO TO SIGNFIX
		COM			# IF - , USE -MAGNITUDE +1
		TS	MPAC		# IF -0, USE +0
SIGNFIX		CCS	OVFIND
		TC	SGNTO1		# IF OVERFLOW
		TC	ENDSCALE	# NO OVERFLOW/UNDERFLOW
		CCS	MPAC		# IF UF FORCE SIGN TO 0 EXCEPT -180
		TC	CCSHOLE
		TC	NEG180
		TC	+1
		XCH	MPAC
		MASK	POSMAX
		TS	MPAC
ENDSCALE	TC	POSTJUMP
		CADR	PUTCOM2

NEG180		CS	POSMAX
		TC	ENDSCALE -1

SGNTO1		CS	MPAC		# IF OF FORCE SIGN TO 1
		MASK	POSMAX
		CS	A
		TC	ENDSCALE -1

DEGCON1		2DEC	5.555555555 B-3
## Page 518
DEGCON2		2DEC	2.222222222 B-2
NEG.2		OCT	-06250		# .197753906  I.E. THE BIAS SCALED

ARTHINSF	TC	DMP		# SCALES MPAC, +1 BY SFTEMP1, SFTEMP2.
		XCADR	SFTEMP1		# ASSUMES POINT BETWEEN HI AND LO PARTS
		XCH	MPAC +2		# OF SFCON. SHIFTS RESULTS LEFT BY 14.
		XCH	MPAC +1		# (BY TAKING RESULTS FROM MPAC+1, MPAC+2)
		XCH	MPAC
		CCS	A
		TC	DSPALARM	# TOO LARGE A LOAD
		TC	BINROUND
		TC	DSPALARM	# TOO LARGE A LOAD
BINROUND	TC	2ROUND
		TC	TESTOFUF
		TC	ENDSCALE	# RETURNS IF NO OF/UF



OPTDEGIN	CCS	MPAC		# OPTICS SCALING ROUTINE
		TC	OPDEGIN2	# LOW RANGE   0 TO 90 DEG ALWAYS
		TC	OPDEGIN2
		TC	DSPALARM	# REJECT - INPUT. ALARM
		TC	DSPALARM	# DITTO



# NO LONGER DO WE TEST BIT 13 OF WASOPSET TO DETERMINE RANGE. RANGE NOW
# IS ALWAYS 90 DEG (BLOCK 50 - 100)



OPDEGIN2	XCH	MPAC		# RANGE IS 90 DEG
		AD	NEG.2		# SUBTRACT BIAS
		TS	MPAC
		TC	DMP		# MULT BY 100 / 45  B-2
		XCADR	DEGCON2
		CAF	BIT12		# ROUND AS IN DEGINSF
		AD	MPAC +1
		TC	2ROUND +2
		TC	DEGINSF2

DPINSF		TC	DMP		# SCALES MPAC, MPAC +1 BY SFTEMP1,
		XCADR	SFTEMP1		# SFTEMP2.  STORES LOW PART OF RESULT
		XCH	MPAC +2		# IN (E SUBK) +1 OR E+1
		DOUBLE
		TS	MPAC +2
		CAF	ZERO
		AD	MPAC +1
		TC	2ROUND +2
## Page 519
		TC	TESTOFUF
		INDEX	MIXBR		# RETURNS IF NO OF/UF
		TC	+0
		TC	DPINORM
		XCH	DECOUNT		# MIXEDNOUN
		TS	DECOUNT
DPINCOM		AD	NOUNADD		#     MIXED		  NORMAL
		TS	Q		#   E SUBK	      E
		XCH	MPAC +1
		INDEX	Q
		TS	1		# PLACE LOW PART IN
		TC	ENDSCALE	# (E SUBK) +1	 MIXED
DPINORM		CAF	ZERO		# E +1	       NORMAL
		TC	DPINCOM



DPINSF2		TC	DMP		# ASSUMES POINT BETWEEN BITS 7-8 OF HIGH
		XCADR	SFTEMP1		# PART OF SF CONST. DPINSF2 SHIFTS RESULTS
		TC	TPLEFT7		# LEFT BY 7, ROUNDS MPAC+2 INTO MPAC+1
		TC	DPINSF +2

TPLEFT7		XCH	Q		# OPERATES ON MPAC, MPAC+1, MPAC+2
		TS	SFTEMP2
		CAF	SIX		# LEFT BY 7
LEFT7COM	TS	SFTEMP1
		TC	BANKCALL
		CADR	SL1
		CCS	SFTEMP1
		TC	LEFT7COM
		TC	SFTEMP2



2ROUND		XCH	MPAC +1
		DOUBLE
		TS	MPAC +1
		TC	Q		# IF MPAC+1 DOES NOT OF/UF
		AD	MPAC
		TS	MPAC
		TC	Q		# IF MPAC DOES NOT OF/UF
		TS	OVFIND
2RNDEND		TC	Q



TESTOFUF	CCS	OVFIND		# RETURNS IF NO OF/UF
		TC	DSPALARM	# OF
## Page 520
		TC	Q
		TC	DSPALARM	# UF

## Page 521

# MONITOR ALLOWS OTHER KEYBOARD ACTIVITY. IT IS ENDED BY VERB TERMINATE,
# ANY NVSUB CALL THAT PASSES THE DSPLOCK, OR ANOTHER MONITOR.
#
# MONITOR ACTION IS SUSPENDED, BUT NOT ENDED, BY ANY KEYBOARD ACTION,
# EXCEPT ERROR LIGHT RESET. IT BEGINS AGAIN WHEN KEY RELEASE IS PERFORMED.
# MONITOR SAVES THE NOUN AND APPROPRIATE DISPLAY VERB IN MONSAVE. IT SAVES
# NOUNADD IN MONSAVE1, IF NOUN = MACHINE ADDRESS TO BE SPECIFIED. BIT 15 OF
# MONSAVE1 IS THE KILL MONITOR SIGNAL (KILLER BIT). 
#
# MONSAVE INDICATES IF MONITOR IS ON (+=ON, +0=OFF)
# IF MONSAVE IS +, MONITOR ENTERS NO REQUEST, BUT TURNS KILLER BIT OFF.
# IF MONSAVE IS +0, MONITOR ENTERS REQUEST AND TURNS KILLER BIT OFF.
#
# NVSUB AND VB=TERMINATE TURN KILL MONITOR BIT ON.
#
# IF KILLER BIT IS ON, MONREQ ENTERS NO FURTHER REQUESTS, ZEROS MONSAVE
# AND MONSAVE1 (TURNING OFF KILLER BIT).
#
#
#
# MONITOR DOESNT TEST FOR MATBS SINCE NVSUB CAN HANDLE INTERNAL MATBS NOW.

		SETLOC	ENDRUTIN

MONITOR		CS	BIT15
		MASK	NOUNADD
MONIT1		TS	MPAC +1		# TEMP STORAGE
		CAF	LOW6
		MASK	VERBREG
		TC	LEFT5
		TS	CYL
		XCH	CYL
		AD	NOUNREG
		TS	MPAC		# TEMP STORAGE
		CS	GRABLOCK	# NEITHER CASE SEARCHES LIST.
		AD	TWO
		CCS	A
		TC	RELDSP1		# GRABLOCK=0,1. +0 INTO DSPLOCK AND
		TC	+3		# TURN OFF KEY RLSE LIGHT.
		TC	CCSHOLE
		TC	DSPLOCK0	# GRABLOCK=2. +0 INTO DSPLOCK AND
					# TURN OFF KEY RLSE LIGHT.
		INHINT
		CCS	MONSAVE
		TC	+4		# IF MONSAVE WAS +, NO REQUEST
		CAF	ONE		# IF MONSAVE WAS 0, REQUEST MONREQ
		TC	WAITLIST
		CADR	MONREQ
		XCH	MPAC
		TS	MONSAVE		# PLACE MONITOR VERB AND NOUN INTO MONSAVE
		XCH	MPAC +1
## Page 522
		TS	MONSAVE1	# ZERO THE KILL MONITOR BIT
		RELINT
		TC	ENTRET



MONREQ		TC	READTIME +1	# CALLED BY WAITLIST
		TC	LODSAMPT	# TIME IS SNATCHED IN RUPT FOR NOUN 65
		CCS	MONSAVE1
		TC	+4		# IF KILLER BIT = 0, ENTER REQUESTS
		TC	+3		# IF KILLER BIT = 0, ENTER REQUESTS
		TC	KILLMON		# IF KILLER BIT = 1, NO REQUESTS
		TC	KILLMON		# IF KILLER BIT = 1, NO REQUESTS
		CAF	MONDEL
		TC	WAITLIST	# ENTER WAITLIST REQUEST FOR MONREQ
		CADR	MONREQ
		CAF	PRIO31
		TC	NOVAC		# ENTER EXEC REQUEST FOR MONDO
		CADR	MONDO
		TC	TASKOVER

KILLMON		CAF	ZERO		# ZERO MONSAVE AND TURN KILLER BIT OFF
		TS	MONSAVE
		TS	MONSAVE1	# TURN OFF KILL MONITOR BIT.
		TC	TASKOVER



MONDEL		OCT	144		# FOR 1 SEC MONITOR INTERVALS



MONDO		CCS	MONSAVE1	# CALLED BY EXEC
		TC	+4		# IF KILLER BIT = 0, CONTINUE
		TC	+3		# IF KILLER BIT = 0, CONTINUE
		TC	ENDOFJOB	# IN CASE TERMINATE CAME SINCE LAST MONREQ
		TC	ENDOFJOB	# IN CASE TERMINATE CAME SINCE LAST MONREQ
		TC	TSTDSPLK	# PERFORMS CCS DSPLOCK
		TC	MONBUSY		# NVSUB IS BUSY
		CAF	LOW6		# NVSUB IS AVAILABLE
		MASK	MONSAVE
		TS	NVTEMP
		TC	NVSUBMON	# PLACE NOUN INTO NOUNREG AND DISPLAY IT
		TC	ENDOFJOB	# IN CASE OF ALARM DURING DISPLAY
		CAF	MONMASK
		MASK	MONSAVE		# CHANGE MONITOR VERB TO DISPLAY VERB
		TC	RIGHT5
		TS	CYR
		XCH	CYR
		TS	VERBREG
## Page 523
		CAF	MONBACK		# SET RETURN TO PASTEVB AFTER DATA DISPLAY
		TS	ENTRET
		CS	BIT15
		MASK	MONSAVE1
		TS	NOUNADD
ENDMONDO	TC	TESTNN

		SETLOC	ENDFAILF
PASTEVB		CAF	MIDSIX
		MASK	MONSAVE
		TS	NVTEMP		# PLACE MONITOR VERB INTO VERBREG AND
		TC	NVSUBMON	#	DISPLAY IT.
		TC	+1
ENDPASTE	TC	ENDOFJOB

MIDSIX		OCT	07700

		SETLOC	ENDMONDO +1
MONMASK		OCT	700
MONBACK		ADRES	PASTEVB

MONBUSY		TC	RELDSPON	# TURN KEY RELEASE LIGHT
		TC	ENDOFJOB

# DSPBANK IS USED TO DISPLAY (IN OCTAL) ANY FIXED REGISTER IN BANK.
# IT IS USED WITH NOUN = MACHINE ADDRESS TO BE SPECIFIED. THE CADR OF THE
# DESIRED LOCATION IS THEN PUNCHED IN. 

DSPBANK		CAF	R1D1
		TS	DSPCOUNT
		CS	NOUNADD
		CS	A
		TC	DATACALL
		TC	DSPOCTWO
		TC	ENDOFJOB



		SETLOC	TSTOFUF +4

#  DSPDECWD CONVERTS C(MPAC) AND C(MPAC+1) INTO A SIGN AND 5 CHAR DECIMAL
# STARTING IN LOC SPECIFIED IN DSPCOUNT.

DSPDECWD	XCH	Q		# USES SHORTMP THROUGHOUT
		TS	WDRET
		CCS	MPAC
## Page 524
		TC	+7
		TC	+6
		AD	ONE
		TS	MPAC
		TC	-ON
		CS	MPAC +1
		TC	+3
		TC	+ON
		XCH	MPAC +1
		AD	DECROUND
		TS	MPAC +1
		CAF	ZERO
		AD	MPAC
		TS	MPAC
		TC	+4
		CAF	POSMAX
		TS	MPAC
		TS	MPAC +1
		CAF	FOUR
DSPDCWD1	TS	WDCNT
		CAF	BINCON
		TC	SHORTMP
TRACE1		INDEX	MPAC
		CAF	RELTAB
		MASK	LOW5
		TS	CODE
		CAF	ZERO
		XCH	MPAC +2
		XCH	MPAC +1
		TS	MPAC
		XCH	DSPCOUNT
TRACE1S		TS	COUNT
		CCS	A		# DECREMENT DSPCOUNT EXCETP AT +0
		TS	DSPCOUNT
		TC	DSPIN
		CCS	WDCNT
		TC	DSPDCWD1
		CS	VD1
		TS	DSPCOUNT
		TC	WDRET

DECROUND	OCT	02476



# DSP2DEC CONVERTS C(MPAC) AND C(MPAC+1) INTO A SIGN AND 10 CHAR DECIMAL
# STARTING IN THE LOC SPECIFIED IN DSPCOUNT.

DSP2DEC		XCH	Q
		TS	WDRET
## Page 525
		CAF	ZERO
		TS	CODE
		CAF	THREE
		TC	11DSPIN		# -R2 OFF
		CAF	FOUR
		TC	11DSPIN		# +R2 OFF
		CCS	MPAC
		TC	+8D
		TC	+7
		AD	ONE
		TS	MPAC
		TC	-ON
		CS	MPAC +1
		TS	MPAC +1
		TC	+2
		TC	+ON
		CAF	R2D1
END2DEC		TC	DSPDCWD1



		SETLOC	DSPBANK +7

# DSPOCTWD DISPLAYS C(A) UPON ENTRY AS A 5 CHAR OCT STARTING IN THE DSP
# CHAR SPECIFIED IN DSPCOUNT. IT STOPS AFTER 5 CHAR HAVE BEEN DISPLAYED.

DSPOCTWO	TS	CYL
		XCH	Q
		TS	WDRET
		XCH	DSPCOUNT
		AD	BIT14		# TO BLANK SIGNS
		TS	DSPCOUNT
		CAF	FOUR
WDAGAIN		TS	WDCNT
		CS	CYL
		CS	CYL
		CS	CYL
		CS	A
		MASK	DSPMSK
		INDEX	A
		CAF	RELTAB
		MASK	LOW5
		TS	CODE
		XCH	DSPCOUNT
		TS	COUNT
		CCS	A		# DECREMENT DSPCOUNT EXCEPT AT +0
		TS	DSPCOUNT
		TC	POSTJUMP
		CADR	DSPOCTIN
OCTBACK		CCS	WDCNT
		TC	WDAGAIN		# +
## Page 526
DSPLV		CS	VD1		# TO BLOCK NUMERICAL CHARACTERS, CLEARS,
		TS	DSPCOUNT	# AND SIGNS AFTER A COMPLETED DISPLAY.
		TC	WDRET

DSPMSK		=	SEVEN



# DSP2BIT DISPLAYS C(A) UPON ENTRY AS A 2 CHAR OCT BEGINNING IN THE DSP
# LOC SPECIFIED IN DSPCOUNT BY PRE CYCLING RIGHT C(A) AND USING THE LOGIC
# OF THE 5 CHAR OCTAL DISPLAY

DSP2BIT		TS	CYR
		XCH	Q
		TS	WDRET
		CAF	ONE
		TS	WDCNT
		CS	CYR
		CS	CYR
		XCH	CYR
		TS	CYL
		TC	WDAGAIN +5



# FOR DSPIN PLACE 0/25 OCT INTO COUNT, 5 BIT RELAY CODE INTO CODE. BOTH
# ARE DESTROYED. IF BIT14 OF COUNT IS 1, SIGN IS BLANKED WITH LEFT CHAR.
# FOR DSPIN1 PLACE 0,1 INTO BIT11 OF CODE, 2 INTO COUNT, REL ADDRESS OF
# DSPTAB ENTRY INTO DSREL.

		SETLOC	END2DEC +1

DSPIN		XCH	Q
		TS	DSEXIT
		CAF	LOW5
		MASK	COUNT
		TS	SR
		XCH	SR
		TS	DSREL
		CAF	BIT1
		MASK	COUNT
		CCS	A
		TC	+2		# LEFT IF COUNT IS ODD
		TC	DSPIN1 -1	# RIGHT IF COUNT IS EVEN
		XCH	CODE
		TC	SLEFT5
		TS	CODE
		CAF	BIT14
		MASK 	COUNT
		CCS	A
## Page 527
		CAF	TWO		# BIT14 = 1, BLANK SIGN
		AD	ONE		# BIT14 = 0, LEAVE SIGN ALONE
		TS	COUNT		# +0 INTO COUNT FOR RIGHT
					# +1 INTO COUNT FOR LEFT (SIGN LEFT ALONE)
					# +3 INTO COUNT FOR LEFT (TO BLANK SIGN)
DSPIN1		INHINT
		INDEX	DSREL
		CCS	DSPTAB
		TC	+2		# IF +
		TC	CCSHOLE
		AD	ONE		# IF-
		TS	DSMAG
		INDEX	COUNT
		MASK	DSMSK
		EXTEND
		SU	CODE
		CCS	A
		TC	DFRNT		# IF+
		TC	CCSHOLE
		TC	DFRNT		# IF-
		TC	DSLV		# IF -0
DFRNT		INDEX	COUNT
		CS	DSMSK		# MASK WITH 77740,76037, OR 75777
		MASK	DSMAG
		AD	CODE
		CS	A
		INDEX	DSREL
		XCH	DSPTAB
		CCS	A
		TC	INCNOUT
		TC	CCSHOLE
DSLV		RELINT
		TC	DSEXIT

DSMSK		OCT	37
		OCT	1740
		OCT	2000
		OCT	3740



# FOR 11DSPIN, PUT REL ADDRESS OF DSPTAB ENTRY INTO A, 1 IN BIT11 OR 0 IN
# BIT11 OF CODE.

11DSPIN		TS	DSREL
		CAF	TWO
		TS	COUNT
		XCH	Q
		TS	DSEXIT
		TC	DSPIN1
## Page 528

DSPOCTIN	TC	DSPIN		# SO DSPOCTWD DOESNT USE SWCALL
		CAF	+2
		TC	BANKJUMP
ENDSPOCT	CADR	OCTBACK



# DSPALARM FINDS TC NVSUBEND IN ENTRET FOR NVSUB INITIATED ROUTINES.
# ABORT WITH OCT 01501.
# DSPALARM FINDS TC ENDOFJOB IN ENTRET FOR KEYBOARD INITIATED ROUTINES.
# DO TC ENTRET.

CHARALRM	CAF	ENDINST		# ALARMS WHICH MUST DO ENDOFJOBS COME
		TS	ENTRET		# HERE. ALLOWS ENTRET TO BE TEMP ERASABLE

DSPALARM	TC	FALTON		# TURN ON CHECK FAIL LIGHT.
		CS	NVSBENDL
		AD	ENTEXIT
		CCS	A
		TC	ENTEXIT		# NOT NVSUB INITIATED.
NVSBENDL	TC	NVSUBEND
		TC	ENTEXIT		# NOT NVSUB INITIATED.
		TC	ABORT		# NVSUB INITIATED.
		OCT	01501



FLASHON1	CAF	BIT11		# GETS HERE THRU FLASHON(STANDARD LEAD IN)
		TS	CODE
		CAF	FLASHLOC
		TS	DSREL
		CAF	TWO
		TS	COUNT
		TC	DSPIN1
FLASHOF1	CAF	ZERO		# GETS HERE THRU FLASHOFF(STANDARD LEAD IN
		TC	FLASHON1 +1
FLASHLOC	OCT	11



# MMCHANG USES NOUN DISPLAY UNTIL ENTER. THEN IT USES MODE DISP.
# IT GOES TO MODROUT WITH THE NEW M M CODE IN A, BUT NOT DISPLAYED IN
# MM LIGHTS.

		SETLOC	DSP2BIT +10D

MMCHANG		TC	REQMM
		CAF	ZERO
		XCH	NOUNREG
		TS	MPAC
## Page 529
		CAF	ND1
		TS	DSPCOUNT
		TC	BANKCALL
		CADR	2BLANK
		XCH	MPAC
		TC	POSTJUMP
		CADR	MODROUTB	# GO THRU STANDARD LOC.



REQMM		CS	Q
		TS	REQRET
		CAF	ND1
		TS	DSPCOUNT
		CAF	ZERO
		TS	NOUNREG
		TC	BANKCALL
		CADR	2BLANK
		TC	BANKCALL
		CADR	FLASHON
		TC	ENTEXIT



# VBRQEXEC ENTERS REQUEST TO EXEC     FOR ANY ADDRESS WITH ANY PRIORITY.
# IT DOES ENDOFJOB AFTER ENTERING REQUEST.ASSUMES PRIO  PRELOADED INTO 
# BITS 10-14 OF FIRST REGISTER OF TEMP AREA, WITH BIT1=0 FOR NOVAC, BIT1
# =1 FOR FINDVAC). THE VERB IS USED WITH NOUN=MACHINE ADDRESS TO BE
# SPECIFIED. CADR JOBADDR IS PUNCHED IN. DISPLAY SYST IS RELEASED.

VBRQEXEC	CAF	ENDINST
		TS	PROGREG +2
		TC	RELDSP
		CAF	BIT1
		MASK	DSPTEM1		# ********
		CCS	A
		TC	SETVAC		# IF BIT1 =1, FINDVAC
		CAF	TCNOVAC		# IF BIT1 =0, NOVAC
REQEX1		TS	PROGREG		# TC NOVAC OR TC FINDVAC INTO PROGREG
		XCH	NOUNADD
		TS	PROGREG +1	# CADR JOBADDR INTO PROGREG +1
		CS	BIT1
		MASK	DSPTEM1		# *******
		INHINT
		TC	PROGREG

SETVAC		CAF	TCFINDVC
		TC	REQEX1

# VBRQWAIT ENTERS REQUEST TO WAITLIST FOR ANY ADDRESS WITH ANY DELAY.
## Page 530
# IT DOES ENDOFJOB AFTER ENTERING REQUEST.ASSUMES DELAY PRELOADED IN FIRST
# REGISTER OF TEMP AREA. THE VERB IS USED WITH NOUN= MACHINE ADDRESS TO
# BE SPECIFIED. CADR TASKADDR IS PUNCHED IN. DISPLAY SYST IS RELEASED.

VBRQWAIT	CAF	ENDINST
		TS	PROGREG +2	# TC ENDOFJOB INTO PROGREG+2
		TC	RELDSP
		CAF	TCWAIT
		TS	PROGREG		# TC WAITLIST INTO PROGREG
		XCH	NOUNADD
		TS	PROGREG +1	# CADR TASKADDR INTO PROGREG+1
		INHINT
		XCH	DSPTEM1		# DELTA T IN A
ENDRQWT		TC	PROGREG



		SETLOC	FLASHLOC +1
VBPROC		CAF	ONE		# PROCEED WITHOUT DATA
		TS	LOADSTAT
		TC	RELDSP
		TC	FLASHOFF
		TC	RECALTST	# SEE IF THERE IS ANY RECALL FROM ENDIDLE



VBTERM		TC	KILMONON	# TURN ON KILL MONITOR BIT
		CS	ONE
		TC	VBPROC +1	# TERM VERB SETS LOADSTAT NEG



# VBRELDSP TURNS OFF RELEASE DISPLAY SYSTEM(AND SEARCHES LIST ONLY
# IF THIS LIGHT WAS TURNED ON BY NVSUBUSY), AND TURNS OFF UPACT LIGHT.

VBRELDSP	CAF	ZERO		# RELEASE DISPLAY SYST
		TS	CODE		# TURN OFF UPACT LIGHT
		CAF	SEVEN
		TC	11DSPIN
		TC	RELDSP		# SEARCHES LIST
		TC	ENDOFJOB



# BUMP SHIFTS WORD DISPLAYED IN R2 TO R3, R1 TO R2. IT BLANKS R1.
## Page 531

BUMP		CAF	FIVE		# R2D5
		TS	DSPCOUNT
		TS	COUNT
		CAF	ONE		# SHIFT DATA OF R2 TO R3, R1 TO R2
		MASK	COUNT
		XCH	COUNT		# +0 INTO COUNT IF EVEN (RIGHT)
		TS	SR		# +1 INTO COUNT IF ODD (LEFT)
		XCH	SR		# DSREL IN A
		INDEX	A
		CCS	DSPTAB
		TC	+2
		TC	CCSHOLE
		AD	ONE		# DSMAG IN A
		INDEX 	COUNT
		MASK	DSMSK
		INDEX	COUNT
		TC	+1
		TC	+2		# EVEN(RIGHT)  OK
		TC	RIGHT5		# ODD(LEFT)  SHIFT RIGHT
		TS	CODE
		CS	FIVE
		AD	DSPCOUNT	# DSPCOUNT-5
		CCS	A		# TO PREVENT -0
		AD	ONE
		TC	+2
		TC	CCSHOLE
		TS	COUNT
		TC	DSPIN		# CODE ALREADY IN CODE
		CS	DSPCOUNT
		AD	R1D1		# OCT 16
		CCS	A
		XCH	DSPCOUNT	# +, DSPCOUNT L/ OCT 16
		AD	ONE		# INCREMENT DSPCOUNT
		TC	BUMP +1

SWSGN		CAF	ZERO		# -0, DSPCOUNT= OCT 16. DO SIGN SHIFT
		TS	DSPCOUNT
		AD	SWTAB +2	# OCT 3
		INDEX	A		# PICKUP ORDER , DSREL=3,4,5,6.
		CCS	DSPTAB		# 		   (-R2,+R2,-R1,+R1)
		TC	+2
		TC	CCSHOLE
		AD	ONE
		MASK	BIT11
		TS	CODE
		INDEX	DSPCOUNT
		CAF	SWTAB		# PUT AWAY ORDER, DSREL= 0,1,3,4.
		TC	11DSPIN		#		   (-R3,+R3,-R2,+R2.)
		CS	DSPCOUNT
		AD	SWTAB +2	# OCT 3
## Page 532
		CCS	A
		XCH	DSPCOUNT	# +, DSPCOUNT L/ 3
		AD	ONE		# INCREMENT DSPCOUNT
		TC	SWSGN +1
		CAF	R1D1		# -0,       DSPCOUNT = 3
		TS	DSPCOUNT
		TC	5BLANK		# BLANKS R1
		TC	ENTEXIT

SWTAB		OCT	0		# -R3
		OCT	1		# +R3
		OCT	3		# -R2
		OCT	4		# +R2



# NVSUB IS USED FOR SUB ROUTINE CALLS FROM WITHIN COMPUTER. IT CAN BE
# USED TO DO ANY THING THE KEYBOARD CAN CALL. PLACE  ...VVVVVVNNNNNN 
# INTO A.      V'S ARE 6 BIT VERB CODE. N'S , 6-BIT NOUN CODE.
#
# NVSUB CAN BE USED WTIH MACH ADDR TO BE SPEC BY PLACING THE ADDRESS INTO
# MPAC+2 BEFORE THE STANDARD NVSUB CALL.
#
#  NVSUB RETURNS TO 2+ CALLING LOC AFTER PERFORMING TASK, IF DISPLAY
# SYSTEM IS AVAILABLE. THE NEW NOUN AND VERB CODES ARE DISPLAYED.
# IF V'S =0, THE NEW NOUN CODE IS DISPLAYED ONLY(RETURN WITH NO FURTHER
# ACTION). IF N'S =0, THE NEW VERB CODE IS DISPLAYED ONLY(RETURN WITH NO
# FURTHER ACTION).
#
# IT RETURNS TO 1+ CALLING LOC WITHOUT PERFORMING TASK, IF DISPLAY
# SYSTEM IS BLOCKED (NOTHING IS DISPLAYED IN THIS CASE).
# IT DOES TC ABORT (WITH OCT 01501) IF IT ENCOUNTERS A DISPLAY PROGRAM
# ALARM CONDITION BEFORE RETURN TO CALLER.
#
# THE DISPLAY SYSTEM IS BLOCKED BY THE DEPRESSION OF ANY
# KEY, EXCEPT ERROR LIGHT RESET. ALSO BY ENDIDLE.
# 	IT IS RELEASED BY SPECIAL VERB = RELEASE DISPLAY, ALL GO TO VERBS,
# PROCEED WITOHOUT DATA, TERMINATE, INITIALIZE EXECUTIVE,
# RECALL PART OF RECALTST IF ENDIDLE WAS USED,
# IN RECALTST IF NVSUB INITIATED LOAD AND ENDIDLE WAS NOT USED,
# VB = REQUEST EXECUTIVE, VB = REQUEST WAITLIST,
# MONITOR SET UP.
#
# A NVSUB CALL THAT PASSES DSPLOCK ENDS OLD MONITOR.
#
# DSPLOCK IS THE INTERLOCK FOR USE OF KEYBOARD AND DISPLAY SYSTEM WHICH
# LOCKS OUT INTERNAL USE WHENEVER THERE IS EXTERNAL KEYBOARD ACTION.
#
# NVSUB IN F/F PLACES 2 + CALLING CADR INTO NVSBCADR, TC NVSUBEND INTO
# ENTRET. IT WILL HANDLE A CALL FROM F/F OK, BUT WILL NOT RESTORE BANKREG
## Page 533
# TO ITS ORIGINAL CONTENTS.

		SETLOC	MIDSIX +1
NVSUB		TS	NVTEMP		# IN FIXED FIXED
		CAF	BIT4
		MASK	DSPLOCK
		CCS	A
		TC	Q		# DSP SYST BLOCKED. RET TO 1+ CALLING LOC
		XCH	Q		# DSP SYST AVAILABLE
		AD	ONE
		TS	TEMQS		# 2+ CALLING CADR INTO TEMQS
		TC	KILMONON	# TURN ON KILL MONITOR BIT
NVSUBCOM	CAF	NVSUBANK
		XCH	BANKREG
		TS	BANKTEM
		TC	MAKECADR
		XCH	ADDRWD
		TS	NVSBCADR
		TC	NVSUBB		# GO TO NVSUB1 THRU STANDARD LOC
NVSUBANK	CADR	NVSUB1		# BANK NUMBER OF NVSUB1

NVSUBMON	XCH	Q		# MONDO COMES HERE
		AD	ONE
		TC	TEMQS
		TC	NVSUBCOM



NVSUBEND	XCH	NVSBCADR
		TC	SWCALL



		SETLOC	ENDRQWAIT +1
NVSUB1		CAF	ENTSET		# IN BANK
		TS	ENTRET		# SET RETURN TO NVSUBEND
		CAF	LOW6
		MASK	NVTEMP
		TS	MPAC		# TEMP STORAGE
		CAF	MID6
		MASK	NVTEMP
		TC	RIGHT5
		TS	CYR
		XCH	CYR
		TS	MPAC +1		# TEMP STORAGE
		CCS	MPAC		# TEST NOUN
		TC	+4		# IF NOUN NOT +0, GO ON
		XCH	MPAC +1
		TC	UPDATVB -1	# IF NOUN = +0, DISPLAY VERB . THEN RETURN
## Page 534
ENTSET		TC	NVSUBEND
		CCS	MPAC +1		# TEST VERB
		TC	+4		# IF VERB NOT +0, GO ON
		XCH	MPAC
		TC	UPDATNN -1	# IF VERB = +0, DISPLAY NOUN . THEN RETURN
		TC	NVSUBEND
		XCH	MPAC +1
		TC	UPDATVB -1	# IF BOTH NOUN AND VERB NOT +0, DISPLAY
		XCH	MPAC		# BOTH AND GO TO ENTPAS0
		TC	UPDATNN -1
		CCS	NNADTEM		# NOUN TABLES WERE READ IN UPDATNN.
		TC	+3		# NORMAL
		TC	GODSPALM	# NOUN NOT IN USE
		TC	MATBSUB
NVSUB2		CAF	ZERO
		TS	LOADSTAT	# SET FOR WAITING FOR DATA CONDITION
		TS	CLPASS
		TS	REQRET		# SET REQRET FOR PASS 0.
		TC	ENTPAS0

MATBSUB		XCH	MPAC +2		# NVSUB CALL LEFT ADDRES FOR MATBS IN
		TS	NOUNADD		# MPAC+2.
		TC	NVSUB2



LOW6		OCT	77
MID6		OCT	7700

		SETLOC	NVSUBEND +2
KILMONON	CS	BIT15		# FORCE BIT 15 OF MONSAVE1 TO 1.
		INHINT			# 	  THIS IS THE KILL MONITOR BIT.
		MASK	MONSAVE1
		AD	BIT15
		TS	MONSAVE1
		RELINT
		TC	Q



# LOADSTAT  +0 INACTIVE(WAITING FOR DATA). SET BY NVSUB
# 	    +1  PROCEED NO DATA. SET BY V33 OR PROCEED
#	   -1 TERMINATE   SET BY V34
#	   -0 DATA IN   SET BY END OF LOAD ROUTINE
#
# L  TC ENDIDLE  (FIXED FIXED)
# ROUTINES THAT REQUEST LOADS THROUGH NVSUB SHOULD USE ENDIDLE WHILE
# WAITING FOR THE DATA TO BE LOADED. ENDIDLE PUTS CURRENT JOB TO SLEEP.
## Page 535
# RECALTST TESTS LOADSTAT AND WAKES JOB UP TO,
# L+1 FOR TERMINATE
# L+2 FOR PROCEED WITHOUT DATA
# L+3 FOR DATA IN
# IT DOES NOTHING     IF LOADSTAT INDICATES WAITING FOR DATA.

ENDIDLE		XCH	Q		# NOVAC ROUTINES ENTER HERE
		TS	TEMQS
		XCH	BANKREG
		TS	BANKTEM
		TC	MAKECADR
		TC	DSPLOCK1	# MAKE DSPLOCK BUSY (BIT 4 OF STATE)
		XCH	ADDRWD
		TS	CADRSTOR
		TC	JOBSLEEP



ENDINST		TC	ENDOFJOB

BNKCON		OCT	5777



# JAMTERM ALLOWS PROGRAMS TO PERFORM THE TERMINATE FUNCTION.
# IT DOES ENDOFJOB.

JAMTERM		CAF	TWENTY8
		TS	REQRET		# LEAVE ENTER AT PASS 0
		TC	BANKCALL
		CADR	UPDATVB -1	# DISPLAY VB 34
		TC	POSTJUMP
		CADR	VBTERM



# DATAWAIT IS AN ALTERNATIVE TO ENDIDLE. IT RETURNS IMMEDIATELY IF
# LOADSTAT INDICATES THAT DATA IS ALREADY IN, OR PROCEED OR TERMINATE HAS
# BEEN EXECUTED. RETURN FORMAT IS SAME AS FOR ENDIDLE.
# DATAWAIT SHOULD BE USED ONLY AFTER REQUESTING A LOAD VERB.

DATAWAIT	XCH	Q
		TS	TEMQS
		CCS	LOADSTAT
		TC	DATWAIT1	# PROCEED,RETURN TO L+2.
		TC	ENDIDLE +2	# STILL WAITING. GO TO SLEEP.
		TC	TEMQS		# TERMINATE. RETURN TO L+1.
		INDEX	TEMQS		# DATA IN. RETURN TO L+3.
		TC	2
DATWAIT1	INDEX	TEMQS		# RETURN TO L+2
## Page 536
		TC	1

# DATAWAIT DOES NOT RELEASE DISPLAY SYST. IT IS RELEASED AT END OF NVSUB
# INITIATED LOAD, IF ENDIDLE WAS NOT USED.



		SETLOC	MID6 +1
# DSPMM  PLACE MAJOR MODE CODE INTO MODREG

DSPMM1		CAF	MD1		# GETS HERE THRU DSPMM (STANDARD LEAD IN)
		XCH	DSPCOUNT	# SAVE DSPCOUNT 
		TS	DSPMMTEM
		CS	MODREG
		CS	A
		TC	DSP2BIT
		XCH	DSPMMTEM	# RESTORE DSPCOUNT
		TS	DSPCOUNT
ENDSPMM1	TC	UPDATRET



# RECALTST IS ENTERED DIRECTLY AFTER DATA IS 
# LOADED, TERMINATE VERB IS EXECUTED, OR THE PROCEED WITHOUT DATA VERB IS
# EXECUTED. IT WAKES UP JOB THAT DID TC ENDIDLE.
#
# IF NVSUB INITIATED LOAD, AND ENDIDLE WAS NOT USED, THEN IT RELEASES
# DISPLAY SYST. (NEEDED FOR DATAWAIT)

		SETLOC	SWTAB +4

RECALTST 	CCS	CADRSTOR
		TC	RECAL1
		TC	ENDOFJOB	# NORMAL EXIT IF KEYBOARD INITIATED
		TC	RECAL1
		TS	CADRSTOR	# -0. CONCLUSION OF NVSUB INITIATED LOAD.
		TC	RECAL3		# +0 INTO CADRSTOR, RELEASE DISPLAY, 
					#    AND ENDOFJOB. NEEDED FOR DATAWAIT.
RECAL1		CAF	ZERO
		XCH	CADRSTOR
		INHINT
		TC	JOBWAKE
		CCS	LOADSTAT
		TC	DOPROC		# + PROCEED WITHOUT DATA
		TC	ENDOFJOB	# PATHALOGICAL CASE EXIT
		TC	DOTERM		# -   TERMINATE
		CS	TWO
RECAL2		INDEX	LOCCTR
		AD	LOC		# LOC IS - FOR BASIC JOBS
		INDEX	LOCCTR
## Page 537
		TS	LOC
		RELINT
RECAL3		TC	RELDSP1		# DOES NOT SEARCH LIST
		TC	ENDOFJOB

DOTERM		CAF	ZERO
		TC	RECAL2

DOPROC		CS	ONE
		TC	RECAL2

## Page 538

# THE FOLLOWING REFERS TO THE NOUN TABLES



		SETLOC	DSPMM1 +6

# COMPONENT CODE NUMBER		INTERPRETATION
#
# 00000				1 COMPONENT
# 00001				2 COMPONENT (EACH S P)
# 00010				3 COMPONENT (EACH SP)



# SF ROUTINE CODE NUMBER	INTERPRETATION
#
# 00000		OCTAL ONLY
# 00001		STRAIGHT FRACTIONAL
# 00010		DEGREES (XXX.XX)
# 00011		ARITHMETIC SF
# 00100		ARITH DP1	OUT(MULT BY 2/14 AT END)	IN(STRAIGHT)
# 00101		ARITH DP2	OUT(STRAIGHT)			IN(SL 7 AT END)
# 00110		OPTICS DEGREES(XX.XXX MAX 89.999) OR (XXX.XX MAX 179.99)
# 00111		ARITH DP3	OUT ( SL 7 AT END)		IN ( STRAIGHT)
# END OF SF ROUTINE CODE NUMBERS



# SF CONSTANT CODE NUMBER	INTERPRETATION
#
# 00000				WHOLE
# 00000				TIME SEC(XXX.XX SEC)SAME AS WHOLE (ARITHDP1)
# 00001				TIME HOURS(XXX.XX) USE ARITH DP2
# 00010				DEGREES
# 00010				OPTICS DEGREES
# 00011				GYRO DEGREES(XX.XXX) USE ARITH DP1
# 00100				GYRO BIAS DRIFT .BBXXXXX MILLIRAD/SEC
# 00101				GYRO AXIS ACCEL. DRIFT
#				.BBXXXXX (MILLIRAD/SEC) / (CM/SEC SEC)
# 00110				PIPA BIAS X.XXXX CM/SEC SEC
# 00111				PIPA SCALE FACTOR ERROR
#					XXXXX. PARTS/MILLION
# 01000				POSITION(XXXX.X KILOMETERS) USE ARITHDP3
# 01001				VELOCITY(XXXX.X METERS/SEC) USE ARITHDP2
# 01010				TIME HOURS(XXX.XX)WEEKS INSIDE(ARITHDP2)
# 01011				ELEVATION DEGREES(89.999MAX) USE ARITH
# 01100				VG FOR 501 (XXXX.X MET/SEC)  USE ARITH
# END OF SF CONSTANT CODE NUMBERS

## Page 539
# FOR GREATER THAN SINGLE PRECISION SCALES, PUT ADDRESS OF MAJOR PART INTO
# NOUN TABLES.
# OCTAL LOADS PLACE +0 INTO MAJOR PART, DATA INTO MINOR PART.
# OCTAL DISPLAYS SHOW MINOR PART ONLY.
# TO GET AT BOTH MAJOR AND MINOR PARTS (IN OCTAL), USE NOUN 01.

## Page 540

# THE FOLLOWING ROUTINES ARE FOR READING THE NOUN TABLES AND THE SF TABLES
# (WHICH ARE IN A SEPARATE BANK FROM THE REST OF PINBALL). THESE READING
# ROUTINES ARE IN THE SAME BANK AS THE TABLES. THEY ARE CALLED BY SWCALL.



# LODNNTAB LOADS NNADTEM WTIH THE NNADTAB ENTRY, NNTYPTEM WITH THE
# NNTYPTAB ENTRY. IF THE NOUN IS MIXED, IDAD1TEM IS LOADED WITH THE FIRST
# IDADDTAB ENTRY, IDAD2TEM THE SECOND IDADDTAB ENTRY, IDAD3TEM THE THIRD
# IDADDTAB ENTRY. MIXBR IS SET FOR MIXED OR NORMAL NOUN.

		SETLOC	ENDEXTVS
LODNNTAB	XCH	Q
		TS	IDAD3TEM	# SAVE RETURN ADDRESS IN IDAD3TEM
		INDEX	NOUNREG
		CAF	NNADTAB
		TS	NNADTEM
		INDEX	NOUNREG
		CAF	NNTYPTAB
		TS	NNTYPTEM
		CS	NOUNREG
		AD	MIXCON
		CCS	A
		TC	LODNORM		# NOUN L/ FIRST MIXED NOUN
		TS	MIXBR		# NORMAL.  +1 INTO MIXBR.
MIXCON		OCT	55		# FIRST MIXED NOUN = 55.
		TC	+1
LODMIXNN	CAF	TWO		# NOUN G/E FIRST MIXED NOUN
		TS	MIXBR
		CAF	LOW10
		MASK	NNADTEM
		TS	Q		# IDADDREL INTO Q
		INDEX	A
		CAF	IDADDTAB
		TS	IDAD1TEM	# LOAD IDAD1TEM	WITH FIRST IDADDTAB ENTRY.
		INDEX	Q
		CAF	IDADDTAB +1
		TS	IDAD2TEM	# LOAD IDAD2TEM WITH 2ND IDADDTAB ENTRY.
		INDEX	Q
		CAF	IDADDTAB +2	# LOAD IDAD3TEM WITH 3RD IDADDTAB ENTRY.
LODNLV		XCH	IDAD3TEM	# PUT RETURN ADDESS INTO A.
		TC	A

LODNORM		CAF	ONE
		TS	MIXBR
		TC	LODNLV



# GTSFOUT LOADS SFTEMP1, SFTEMP2 WTIH THE DP SFOUTAB ENTRIES.
## Page 541

GTSFOUT		INDEX	SFTEMP2		# SF CONUM ARRIVES IN SFTEMP2.
		CAF	SFOUTAB1
		TS	SFTEMP1
		INDEX	SFTEMP2
		CAF	SFOUTAB2
		TS	SFTEMP2
		TC	Q



# GTSFIN LOADS SFTEMP1, SFTEMP2 WITH THE DP SFINTAB ENTRIES.

GTSFIN		INDEX	SFTEMP2		# SF CONUM ARIVES IN SFTEMP2.
		CAF	SFINTAB1
		TS	SFTEMP1
		INDEX	SFTEMP2
		CAF	SFINTAB2
		TS	SFTEMP2
		TC	Q



					# NN   NORMAL NOUNS
NNADTAB		OCT	00000		# 00 NOT IN USE
		OCT	40000		# 01 SPECIFY MACHINE ADDRESS (FRACTIONAL)
		OCT	40000		# 02 SPECIFY MACHINE ADDRESS (WHOLE)
		OCT	40000		# 03 SPECIFY MACHINE ADDRESS (DEGREES)
		OCT	40000		# 04 SPECIFY MACHINE ADDRESS (HOURS)
		OCT	40000		# 05 SPECIFY MACHINE ADDRESS (SECONDS)
		OCT	40000		# 06 SPECIFY MACHINE ADDRESS (GYRO DEG)
		OCT	40000		# 07 SPECIFY MACHINE ADDRESS (Y OPT DEG.)
		OCT	00000		# 10 SPARE
		OCT	00000		# 11 SPARE
		OCT	00000		# 12 SPARE
		OCT	00000		# 13 SPARE
		OCT	00000		# 14 SPARE
		OCT	77777		# 15 INCREMENT MACHINE ADDRESS
		OCT	00035		# 16 TIME SECONDS
		OCT	00035		# 17 TIME HOURS
		ADRES	CDUX		# 20 ICDU
		ADRES	PIPAX		# 21 PIPAS
		ADRES	THETAD		# 22 NEW ANGLES I
		ADRES	DSPTEM2		# 23 DELTA ANGLES I
		ADRES	DSPTEM1		# 24 DELTA TIME (SEC)
		ADRES	DSPTEM1		# 25 CHECKLIST
		ADRES	DSPTEM1		# 26 PRIO/DELAY
		ADRES	SMODE		# 27 SELF TEST ON/OFF SWITCH
		ADRES	DSPTEM1		# 30 STAR NUMBERS
		ADRES	FAILREG		# 31 FAILREG, SFAIL, ERCOUNT
		ADRES	TDEC		# 32 DECISION TIME (MIDCOURSE)
## Page 542
		ADRES	TET		# 33 EPHEMERIS TIME(MIDCOURSE)
		ADRES	MEASQ		# 34 MEASURED QUANTITY (MIDCOURSE)
		ADRES	ROLL		# 35 ROLL, PITCH, YAW
		ADRES	LANDMARK	# 36 LANDMARK DATA 1
		ADRES	LANDMARK +3	# 37 LANDMARK DATA 2
		ADRES	DSPTEM1		# 40 VG FOR 501
		OCT	00000		# 41 SPARE
		OCT	00000		# 42 SPARE
		OCT	00000		# 43 SPARE
		OCT	00000		# 44 SPARE
		OCT	00000		# 45 SPARE
		OCT	00000		# 46 SPARE
		OCT	00000		# 47 SPARE
		OCT	00000		# 50 SPARE
		OCT	00000		# 51 SPARE
		ADRES	GBIASX		# 52 GYRO BIAS DRIFT
		ADRES	ADIAX		# 53 GYRO INPUT AXIS ACCELERATION DRIFT
		ADRES	ADSRAX		# 54 GYRO SPIN AXIS ACCELERATION DRIFT

					# NN  MIXED NOUNS
		OCT	02000		# 55 OCDU
		OCT	04002		# 56 UNCALLED MARK DATA (OCDU & TIME(SEC))
		OCT	02005		# 57 NEW ANGLES OCDU
		OCT	04007		# 60 IMU MODE STATUS
		OCT	02012		# 61 TARGET AZIMUTH AND ELEVATION
		OCT	04062		# 62 RE-RENTRY VARIABLES
		OCT	02016		# 63 OCDUX AND TIME(SEC)
		OCT	02020		# 64 OCDUY AND TIME(SEC)
		OCT	02022		# 65 SAMPLED TIME (HOURS AND SECONDS)
					#	(FETCHED IN INTERRUPT)
		OCT	04024		# 66 SYSTEM TEST RESULTS
		OCT	04027		# 67 DELTA GYRO ANGLES
		OCT	04032		# 70 PIPA BIAS
		OCT	04035		# 71 PIPA SCALE FACTOR ERROR
		OCT	04040		# 72 DELTA POSITION
		OCT	04043		# 73 DELTA VELOCITY
		OCT	04046		# 74 MEASUREMENT DATA (MIDCOURSE)
		OCT	04051		# 75 MEASUREMENT DEVIATIONS (MIDCOURSE)
		OCT	04054		# 76 POSITION VECTOR
		OCT	04057		# 77 VELOCITY VECTOR



					# NN        NORMAL NOUNS
NNTYPTAB	OCT	00000		# 00 NOT IN USE
		OCT	00040		# 01 1COMP  FRACTIONAL
		OCT	00140		# 02 1COMP  WHOLE
		OCT	00102		# 03 1COMP  DEGREES
		OCT	00241		# 04 1COMP  HOURS
		OCT	00200		# 05 1COMP  SECONDS
## Page 543
		OCT	00203		# 06 1COMP  OCTAL ONLY
		OCT	00302		# 07 1COMP  OCTAL ONLY
		OCT	00000		# 10        SPARE
		OCT	00000		# 11        SPARE
		OCT	00000		# 12        SPARE
		OCT	00000		# 13        SPARE
		OCT	00000		# 14        SPARE
		OCT	00000		# 15 1COMP  OCTAL ONLY
		OCT	00200		# 16 1COMP  SECONDS
		OCT	00241		# 17 3COMP  HOURS
		OCT	04102		# 20 3COMP  DEGREES
		OCT	04140		# 21 3COMP  WHOLE
		OCT	04102		# 22 3COMP  DEGREES
		OCT	04102		# 23 3COMP  DEGREES
		OCT	00200		# 24 1COMP  SECONDS
		OCT	00140		# 25 1COMP  WHOLE
		OCT	00140		# 26 1COMP  WHOLE
		OCT	00140		# 27 1COMP  WHOLE
		OCT	04140		# 30 3COMP  WHOLE
		OCT	04000		# 31 3COMP  HMS (DEC ONLY)
		OCT	00252		# 32 3COMP  HMS (DEC ONLY)
		OCT	00252		# 33 3COMP  HMS (DEC ONLY)
		OCT	00350		# 34 3COMP  HMS (DEC ONLY)
		OCT	04102		# 35 3COMP  HMS (DEC ONLY)
		OCT	04000		# 36 3COMP  HMS (DEC ONLY)
		OCT	04000		# 37 3COMP  HMS (DEC ONLY)
		OCT	04154		# 40 3COMP  VG FOR 501
		OCT	00000		# 41        SPARE
		OCT	00000		# 42        SPARE
		OCT	00000		# 43        SPARE
		OCT	00000		# 44        SPARE
		OCT	00000		# 45        SPARE
		OCT	00000		# 46        SPARE
		OCT	00000		# 47        SPARE
		OCT	00000		# 50        SPARE
		OCT	00000		# 51        SPARE
		OCT	04144		# 52 3COMP  GYRO BIAS DRIFT
		OCT	04145		# 53 3COMP  GYRO AXIS ACCEL. DRIFT
		OCT	04145		# 54 3COMP  GYRO AXIS ACCEL. DRIFT

					# NN        MIXED NOUNS
		OCT	00102		# 55 2COMP  DEGREES, Y OPT DEGREES
		OCT	00102		# 56 3COMP  DEGREES, Y OPT DEGREES, SECS
		OCT	00102		# 57 2COMP  DEGREES, Y OPT DEGREES
		OCT	00000		# 60 3COMP  OCTAL ONLY
		OCT	00542		# 61 2COMP  DEGREES, ELEVATION DEGREES
		OCT	00000		# 62 3COMP  SECS, WHOLE, WHOLE
		OCT	00002		# 63 2COMP  DEGREES, SECS
		OCT	00002		# 64 2COMP  Y OPT DEGREES, SECS
		OCT	00001		# 65 2COMP  HOURS, SECONDS
## Page 544
		OCT	00000		# 66 3COMP  WHOLE, FRACTIONAL, WHOLE
		OCT	06143		# 67 3COMP  GYRO DEGREES FOR EACH
		OCT	14306		# 70 3COMP  PIPA BIAS FOR EACH
		OCT	16347		# 71 3COMP  PIPA SCALE FACTOR ERR.FOR EACH
		OCT	20410		# 72 3COMP  POSITION FOR EACH
		OCT	22451		# 73 3COMP  VELOCITY FOR EACH
		OCT	00412		# 74 3COMP  TIME WEEKS, POSITION, POSITION
		OCT	20450		# 75 3COMP  POSITION, VELOCITY, POSITION
		OCT	20410		# 76 3COMP  POSITION FOR EACH
		OCT	22451		# 77 3COMP  VELOCITY FOR EACH



SFINTAB1	OCT	00006		# WHOLE,TIME(SEC)		HIGH PART
		OCT	00253		# TIME HOURS(=1.3-, PT. BETWEEN BITS 7-8)
		OCT	0		# DEGREES
		OCT	00021		# GYRO DEGREES
		OCT	00001		# GYRO BIAS DRIFT
		OCT	00011		# GYRO AXIS ACCEL. DRIFT
		OCT	00004		# PIPA BIAS
		OCT	00314		# PIPA SCALE ERROR
		OCT	23420		# POSITION
		OCT	00201		# VELOCITY (POINT BETWEEN BITS 7-8)
		OCT	01371		# TIME WEEKS (POINT BETWEEN BITS 7-8)
		OCT	00001		# ELEVATION DEGREES
		OCT	00003		# VG FOR 501
# END OF SFINTAB1



SFINTAB2	OCT	03240		# WHOLE, TIME(SEC)		LO PART
		OCT	25124		# TIME HOURS
		OCT	0		# DEGREES ( SFCON IN DEGINSF)
		OCT	30707		# GYRO DEGREES
		OCT	02133		# GYRO BIAS DRIFT
		OCT	30322		# GYRO AXIS ACCEL. DRIFT
		OCT	14021		# PIPA BIAS
		OCT	31463		# PIPA SCALE ERROR
		OCT	00000		# POSITION
		OCT	30327		# VELOCITY
		OCT	34750		# TIME WEEKS
		OCT	03434		# ELEVATION DEGREES
		OCT	04000		# VG FOR 501
# END OF SFINTAB2



SFOUTAB1	OCT	05174		# WHOLE, TIME(SEC)		HIGH PART
		OCT	27670		# TIME HOURS
		OCT	0		# DEGREES
## Page 545
		OCT	01631		# GYRO DEGREES
		OCT	35753		# GYRO BIAS DRIFT
		OCT	03216		# GYRO AXIS ACCEL. DRIFT
		OCT	07237		# PIPA BIAS
		OCT	00120		# PIPA SCALE ERROR
		OCT	00321		# POSITION (POINT BETWEEN BITS 7-8)
		OCT	37441		# VELOCITY
		OCT	05300		# TIME WEEKS
		OCT	34631		# ELEVATION DEGREES
		OCT	12172		# VG FOR 501
# END OF SFOUTAB1



SFOUTAB2	OCT	13261		# WHOLE, TIME(SEC)		LO PART
		OCT	31357		# TIME HOURS
		OCT	0		# DEGREES
		OCT	23146		# GYRO DEGREES
		OCT	32323		# GYRO BIAS DRIFT
		OCT	06400		# GYRO AXIS ACCEL. DRIFT
		OCT	37776		# PIPA BIAS
		OCT	00000		# PIPA SCALE ERROR
		OCT	26706		# POSITION
		OCT	14247		# VELOCITY
		OCT	20305		# TIME WEEKS
		OCT	23146		# ELEVATION DEGREES
		OCT	34121		# VG FOR 501
# END OF SFOUTAB2



					# MIXNOUN  SF ROUT		REG
IDADDTAB	CADR	OPTX 	+04000	# 01	   DEGREES		52
		CADR	OPTY 	+14000	# 01	   Y OPT DEGREES	53
		OCT	DSPTEM1 +04000	# 02	   DEGREES		627
		CADR	DSPTEM1 +14001	# 02	   Y OPT DEGREES	630
		CADR	DSPTEM1 +10002	# 02	   SEC			631
		CADR	DESOPTX +04000	# 03	   DEGREES		724
		CADR	DESOPTX +14001	# 03	   Y OPT DEGREES	725
		CADR	IN3		# 04	   OCTAL ONLY
		CADR	WASKSET		# 04	   OCTAL ONLY
		CADR	OLDERR		# 04	   OCTAL ONLY
		CADR	DSPTEM1 +04000	# 05	   DEGREES
		CADR	DSPTEM1 +06001	# 05	   ELEVATION DEGREES
		OCT	00000		# N 62 WAS 2COMP. CHANGED TO 3COMP. MOVED
		OCT	00000		# TO END OF IDADDTAB TO PRESERVE TABLE.
		CADR	OPTX 	+04000	# 07	   DEGREES		52
		CADR	TIME2 	+10000	# 07	   SEC			35
		CADR	OPTY 	+14000	# 10	   Y OPT DEGREES	53
		CADR	TIME2 	+10000	# 10	   SEC			35
## Page 546
		CADR	SAMPTIME +12000	# 11	   HOURS		655
		CADR	SAMPTIME +10000 # 11	   SECONDS		655
		CADR	DSPTEM2 +06000	# 12	   WHOLE		632
		CADR	DSPTEM2 +02001	# 12	   FRACTIONAL		633
		CADR	DSPTEM2 +06002	# 12	   WHOLE		634
		CADR	OGC 	+10000	# 13	   GYRO DEGREES
		CADR	OGC 	+10002	# 13	   GYRO DEGREES
		CADR	OGC 	+10004	# 13	   GYRO DEGREES
		CADR	PBIASX 	+06000	# 14	   PIPA BIAS
		CADR	PBIASY 	+06000	# 14	   PIPA BIAS
		CADR	PBIASZ 	+06000	# 14	   PIPA BIAS
		CADR	PIPASCFX +06000	# 15	   PIPA SCALE FACTOR ERROR
		CADR	PIPASCFY +06000	# 15	   PIPA SCALE FACTOR ERROR
		CADR	PIPASCFZ +06000	# 15	   PIPA SCALE FACTOR ERROR
		CADR	DELR 	+16000	# 16	   POSITION
		CADR	DELR 	+16002	# 16	   POSITION
		CADR	DELR 	+16004	# 16	   POSITION
		CADR	DELVEL 	+12000	# 17	   VELOCITY
		CADR	DELVEL 	+12002	# 17	   VELOCITY
		CADR	DELVEL 	+12004	# 17	   VELOCITY
		CADR	TDEC 	+12000	# 20	   TIME WEEKS
		CADR	MEASQ 	+16000	# 20	   POSITION
		CADR	MEASMODE +06000	# 20	   WHOLE
		CADR	DSPTEM1 +16000	# 21	   POSITION
		CADR	DSPTEM1 +12002	# 21	   VELOCITY
		CADR	DELTAQ 	+16000	# 21	   POSITION
		CADR	DSPTEM1 +16000	# 22	   POSITION
		CADR	DSPTEM1 +16002	# 22	   POSITION
		CADR	DSPTEM1 +16004	# 22	   POSITION
		CADR	DSPTEM1 +12000	# 23	   VELOCITY
		CADR	DSPTEM1 +12002	# 23	   VELOCITY
		CADR	DSPTEM1 +12004	# 23	   VELOCITY
		CADR	TIME2 	+10000	# 06	   SEC
		CADR	V 	+06000	# 06	   WHOLE
		CADR	THETAH 	+06000	# 06	   WHOLE
		OCT	00000		#	   SPARE
		OCT	00000		#	   SPARE
		OCT	00000		#	   SPARE

## Page 547

# MISCELLANEOUS SERVICE ROUTINES



		SETLOC	DATWAIT1 +2

R1D1		OCT	16
R2D1		OCT	11
R3D1		OCT	4

RIGHT5		TS	CYR
		CS	CYR
		CS	CYR
		CS	CYR
		CS	CYR
		XCH	CYR
		TC	Q

LEFT5		TS	CYL
		CS	CYL
		CS	CYL
		CS	CYL
		CS	CYL
		XCH	CYL
		TC	Q

SLEFT5		DOUBLE
		DOUBLE
		DOUBLE
		DOUBLE
		DOUBLE
		TC	Q



LOW5		OCT	37
MID5		OCT	1740
		OCT	76000		# MUST STAY HERE.

TCNOVAC		TC	NOVAC
TCWAIT		TC	WAITLIST
TCTSKOVR	TC	TASKOVER
TCFINDVC	TC	FINDVAC



VD1		OCT	23
ND1		OCT	21
MD1		OCT	25

## Page 548

BINCON		DEC	10

TEN		EQUALS	BINCON

FALTON		INHINT			# TURN PROGRAM CHECK LIGHT ON
		CS	BIT5		# OUT1,BIT5(ALSO KNOWN AS ILLEGAL ORDER)
		MASK	OUT1
		AD	BIT5
		TS	OUT1
		RELINT
		TC	Q

FALTOF		INHINT
		CS	BIT5
		MASK	OUT1
		TS	OUT1
		RELINT
		TC	Q

RELDSPON	INHINT			# TURN ON RELEASE DISPLAY SYST LIGHT
		CS	BIT3
		MASK	OUT1
		AD	BIT3
		TS	OUT1
		RELINT
		TC	Q

DSPLOCK0	CS	BIT4
		INHINT			# DSPLOCK = BIT4 OF STATE
		MASK	DSPLOCK
		TS	DSPLOCK
		RELINT
		TC	Q
		
DSPLOCK1	CS	BIT4
		INHINT			# DSPLOCK = BIT4 OF STATE
		MASK	DSPLOCK
		AD	BIT4
		XCH	DSPLOCK		# LEAVES OLD C(DSPLOCK) IN A.
		RELINT
		TC	Q

TSTDSPLK	CAF	BIT4		# SIMULATES CCS DSPLOCK
		MASK	DSPLOCK
		CCS	A
		TC	Q		# DSPLOCK = 1, RETURN TO L+1
		INDEX	Q
		TC	1		# DSPLOCK = 0, RETURN TO L+1

## Page 549

# INTERNAL ROUTINES THAT USE THE KEYBOARD AND DISPLAY SYSTEM(THRU
# NVSUB) MUST  TC GRABDSP  BEFOREHAND , TO GRAB THE DISPLAY SYSTEM AND
# MAKE IT BUSY TO OTHER INTERNAL USERS.
#
#	WHEN FINISHED , THERE MUST BE A TC FREEDSP , TO RELEASE THE
# SYSTEM FOR OTHER INTERNAL USERS.
#
#	THE CALLING SEQUENCES ARE
# L	TC	GRABDSP
# L+1	RETURN HERE WHEN SYSTEM IS ALREADY GRABBED
# L+2	RETURN HERE MEANS YOU HAVE IT
#
# L	TC	NVSUB
# L+1	RETURN HERE IF OPERATOR HAS INTERVENED
# L+2	RETURN HERE AFTER EXECUTION



# 	A ROUTINE CALLED GRABUSY IS PROVIDED (USE IS OPTIONAL) TO PUT YOUR
# JOB TO SLEEP UNTIL  THE SYSTEM IS FREED BY THE JOB HOLDING IT. 
# YOUR CADR IS PUT AT FIRST AVAILABLE SLOT IN A WAITING LIST (FIFO).
#
#	THE CALLING SEQUENCE IS
#		CAF	WAKECADR
#		TC	GRABUSY
#
#	A ROUTINE CALLED  NVSUBUSY IS PROVIDED (USE IS OPTIONAL)  TO PUT
# YOUR JOB TO SLEEP UNTIL THE OPERATOR RELEASES IT. YOUR CADR IS PUT
# ON TOP OF A WAITING LIST (FIFO). IT ALSO TURNS ON KEY RELEASE LIGHT.
#
# THE CALLING SEQUENCE IS
# CAF WAKECADR
# TC NVSUBUSY



# AFTER A TC FREEDSP, THE INTERNAL INTERLOCK IS KEPT BUSY FOR 10 SECONDS, 
# AFTER WHICH A CADR IS CALLED FROM THE LIST. THIS INSURES THAT ALL
# DISPLAYS WAITING WILL BE VISIBLE.



# GRABLOCK IS THE INTERNAL INTERLOCK FOR THE USE OF THE KEYBOARD
# AND DISPLAY SYSTEM.
# +0  FREE
# +1  SOME INTERNAL ROUTINE HAS GRABBED DSP SYST
# +2  SOME INTERNAL ROUTINE HAS GONE TO NVSUBUSY

## Page 550

GRABDSP		CCS	GRABLOCK
		TC	Q		# GRABBED. RETURN TO L+1
		CAF	ONE		# NOT GRABBED. SET TO +1
		TS	GRABLOCK	# AND RETURN TO L+2
		INDEX	Q
		TC	1



PREGBSY		CAF	LOW10		# SPECIAL ENTRANCE FOR ROUTINES IN BANKS
		MASK	Q		# DESIRING THE CADR OF 1 + (LOC FROM WHICH
		AD	BANKREG		# TC PREGBSY WAS DONE) TO BE ENTERED.
GRABUSY		TC	POSTJUMP
		CADR	GRABUSYB
		SETLOC	ENDSPMM1 +1

GRABUSY1	TS	CADRTEM
		CCS	GRABLOCK
		TC	+3		# STILL GRABBED
		XCH	CADRTEM		# NOT GRABBED SO DO DIRECT CALL
		TC	BANKJUMP
		CAF	TWO
		TS	LSTPTR
		INDEX	LSTPTR		# SEARCH LIST FOR FIRST AVAILABLE SPACE
		CCS	DSPLIST		# FROM BOTTOM.
		TC	+2
		TC	PUTINLST	# SPACE FOUND
		CCS	LSTPTR		# DECREMENT POINTER
		TC	-6
		TC	LSTFULL
PUTINLST	XCH	CADRTEM
		INDEX	LSTPTR
		TS	DSPLIST
		TC	JOBSLEEP



		SETLOC	GRABUSY +2
PRENVBSY	CS	6K+3		# SPECIAL ENTRANCE FOR ROUTINES IN BANKS
		AD	Q		# DESIRING THE CADR OF (LOC FROM WHICH THE
		AD	BANKREG		# TC PRENVBSY WAS DONE) -2 TO BE ENTERED.
NVSUBUSY	TC	POSTJUMP
		CADR	NVSUBSYB
6K+3		OCT	6003		# TC PRENVBSY WAS DONE) -2 TO BE ENTERED.

		SETLOC	PUTINLST +4
NVSUBSY1	TS	CADRTEM
		TC	TSTDSPLK	# TEST IF REALLY LOCKED OUT
		TC	+3		# STILL BUSY
		XCH	CADRTEM		# DSPLOCK = +0 SO RETURN DIRECTLY
## Page 551
		TC	BANKJUMP
		CAF	TWO		# SET FOR GRABBED STATE AND NVSUBUSY USE
		TS	GRABLOCK
		XCH	CADRTEM
		XCH	DSPLIST +2	# ENTER CADR INTO FIRST POSITION OF LIST
		XCH	DSPLIST +1	# 	(BOTTOM)
		XCH	DSPLIST
		CCS	A
		TC	LSTFULL
		TC	+2
		TC	LSTFULL
		TC	RELDSPON
		CS	DSPLIST +2
		COM
ENDNVBSY	TC	JOBSLEEP

		SETLOC	NVSUBUSY +3

RELDSP		XCH	Q		# SET DSPLOCK TO +0, TURN RELDSP LIGHT
		TS	RELRET		# OFF,  SEARCH DSPLIST
		CAF	NEG1
		AD	GRABLOCK
		CCS	A		# SEARCH LIST ONLY IF GRABLOCK = +2
		TC	+4		# 	(SOMEONE USED NVSUBUSY)
		TC	CCSHOLE
		TC	RELDSP2
		TC	RELDSP2
		CAF	ZERO
		XCH	DSPLIST
		XCH	DSPLIST +1
		XCH	DSPLIST +2
		TS	CADRTEM
		CCS	A
		TC	+2
		TC	RELDSP2		# LIST EMPTY
		XCH	CADRTEM
		INHINT
		TC	JOBWAKE
		CAF	ONE
		TS	GRABLOCK
RELDSP2		CS	BIT3
		MASK	OUT1
		TS	OUT1
		TC	DSPLOCK0	# 0 INTO DSPLOCK (BIT4 OF STATE)
					# RELINT IS DONE IN DSPLOCK0.
		TC	RELRET
RELDSP1		XCH	Q		# SET DSPLOCK TO +0, RELDSP LIGHT OFF, 
		TS	RELRET		# NO LIST SEARCH
		INHINT
		TC	RELDSP2

## Page 552

FREEDSP		XCH	Q
		TS	FREERET
		INHINT
		CAF	SHOTIME
		TC	WAITLIST
		CADR	FREEWAIT
		RELINT
		TC	FREERET

SHOTIME		DEC	175		# SET FOR 1.75 SECS FOR 501
		SETLOC	ENDNVBSY +1

FREEWAIT	CAF	PRIO31		# CALLED BY T3RUPT
		TC	NOVAC
		CADR	FREDSPDO
		TC	TASKOVER



FREDSPDO	CAF	ZERO		# CALLED BY EXECUTIVE
		XCH	DSPLIST
		XCH	DSPLIST +1
		XCH	DSPLIST +2
		TS	CADRTEM
		CCS	A
		TC	+2
		TC	LSTEMPTY
		XCH	CADRTEM
		INHINT
		TC	JOBWAKE
		RELINT
		CAF	ONE		# SET FOR GRABBED CONDITION
		TS	GRABLOCK
		TC	ENDOFJOB
LSTEMPTY	CAF	ZERO		# SET FOR FREE CONDITION
		TC	-3



LSTFULL		TC	ABORT
		OCT	01206		# PINBALL WAITING LINE FULL.
